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) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Permissions not working for custom component
Pages: [1]

Author Topic: Permissions not working for custom component  (Read 1481 times)

dschafer

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 3
    • Backoffice Thinking
  • CiviCRM version: 3.2.3 - 4.4.4
  • CMS version: Drupal 6.x, 7.x, Wordpress
  • MySQL version: 5.1.x - 5.5.x
  • PHP version: 5.2.x - 5.4.x
Permissions not working for custom component
October 14, 2011, 01:31:01 pm
We have a client running our custom AR component on 3.3.5

The app has been running since Jan with no issues. Suddenly yesterday it appears that none for the permissions for the custom component.

The component has as set of menu options (here is a sample as returned by CRM_Core_BAO_Navigation::buildNavigationTree)

Code: [Select]
    [222] => Array
        (
            [attributes] => Array
                (
                    [label] => AR Module
                    [name] => AR Module
                    [url] =>
                    [permission] => access CiviCRM,access ARModule
                    [operator] => AND
                    [separator] => 0
                    [parentID] =>
                    [navID] => 222
                    [active] => 1
                )

            [child] => Array
                (
                    [223] => Array
                        (
                            [attributes] => Array
                                (
                                    [label] => Create a batch
                                    [name] => Create a batch
                                    [url] => civicrm/armodule/batch/add&reset=1&action=add&context=standalone
                                    [permission] => access CiviCRM,access ARModule
                                    [operator] => AND
                                    [separator] => 0
                                    [parentID] => 222
                                    [navID] => 223
                                    [active] => 1
                                )


To access the "Create Batch" function users need access Civi and access ARModule

If I check user_access() for those permissions both result in true. However when the page is accessed result is accessed denied.

We don't have any permission checking within the component itself.

Already tried:
  • disable and re-enable the component
  • logout / login
  • clear template cache

Can anyone suggest anything else? I've really hit a block on this one.
« Last Edit: October 14, 2011, 01:32:38 pm by dschafer »

dschafer

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 3
    • Backoffice Thinking
  • CiviCRM version: 3.2.3 - 4.4.4
  • CMS version: Drupal 6.x, 7.x, Wordpress
  • MySQL version: 5.1.x - 5.5.x
  • PHP version: 5.2.x - 5.4.x
[Resolved]Re: Permissions not working for custom component
October 17, 2011, 09:42:10 am
Resolution

The problem was that for some of the urls, the default Drupal permission module was being called with no arguments which always return false (no access).

Apparently having an empty access_argument element in your menu xml file such as:

<access_arguments></access_arguments>

which we expect to mean no access requirements, is not the the equivalent of the the element being absent.

Not sure why it worked for the previous 9 months - but this if what we found out today.


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Permissions not working for custom component

This forum was archived on 2017-11-26.