CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Unit Testing (Moderator: Michał Mach) »
  • How to test the permissions ?
Pages: [1]

Author Topic: How to test the permissions ?  (Read 1779 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
How to test the permissions ?
January 12, 2011, 01:47:27 am
Hi,

Wanted to confirm there isn't a way now in the unit to switch users and verify that the permissions are properly applied (eg. dude that doesn't have permission X can't do Y and get a proper error msg).

Would it be possible to add easily?

http://forum.civicrm.org/index.php/topic,18041.0/topicseen.html

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: How to test the permissions ?
January 12, 2011, 03:07:19 am
No good way in unit tests at the moment. It's being done in webtests, but that's not that useful for API I guess. Last time I checked (and implemented dummy UF which returns true for permission requests), the problem was having no session when unit tests are run - maybe we should plan for coming back to it and trying to implement some kind of a mock session.

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Unit Testing (Moderator: Michał Mach) »
  • How to test the permissions ?

This forum was archived on 2017-11-26.