Page 1 of 1

Modules are not working

PostPosted: Mon Jan 28, 2013 2:19 pm
by jerryevo
I have added following into my conf.ini

Code: Select all
[_modules]
     modules_DataGrid="modules/DataGrid/DataGrid.php"
     modules_summary="modules/Summary/summary.php"
     modules_switchuser="modules/SwitchUser/switch_user.php"


Modules are in their proper paths (like above, letter case is identical).

But even user with ADMIN nor MANAGER role desn't see "Grid" and "Summary" tabs nor switch user button.
I'm using Xataface 2.0alpha1

Any ideas what to do?

Re: Modules are not working

PostPosted: Fri Feb 01, 2013 3:34 am
by jerryevo
Any ideas?

Re: Modules are not working

PostPosted: Mon Feb 04, 2013 9:51 am
by shannah
What does your getPermissions() method look like?

Re: Modules are not working

PostPosted: Mon Feb 04, 2013 12:41 pm
by jerryevo
Code: Select all
function getPermissions(&$record){
         $auth =& Dataface_AuthenticationTool::getInstance();
         $user =& $auth->getLoggedInUser();

         if ( !isset($user) ) {
         return Dataface_PermissionsTool::NO_ACCESS();
         }
         $role = $user->val('Rola');
            return Dataface_PermissionsTool::getRolePermissions($role);
      }


User I'm using for tests has field "Rola" set to "ADMIN"

Re: Modules are not working

PostPosted: Mon Feb 04, 2013 12:50 pm
by shannah
The ADMIN role is actually different than Dataface_PermissionsTool::ALL().

For the actual admin (i.e. super user) you may want to use Dataface_PermissionsTool::ALL(). It gives access to all permissions in the system. The ADMIN role includes most of the built-in permissions, but permissions added by you or modules are not automatically added to the ADMIN role.

You can add permissions to the ADMIN role using the notation:
Code: Select all
[ADMIN > ADMIN]
    permission1=1
etc...


In your application's permissions.ini file. Check the permissions.ini files for each module to see which permissions you need to permit.

-Steve

Re: Modules are not working

PostPosted: Mon Feb 04, 2013 12:55 pm
by jerryevo
I will try to check it.

It is clear that such great product have to had updated documentation :D

Re: Modules are not working

PostPosted: Mon Feb 04, 2013 1:39 pm
by jerryevo
OK, seems to work!

There was need to update actions.ini file too

[ADMIN > ADMIN] is the same as [ADMIN extends ADMIN]?

Re: Modules are not working

PostPosted: Mon Feb 04, 2013 2:00 pm
by shannah
Oh... oops. I think [ADMIN extends ADMIN] is correct. The > notation is for actions... it may work for permissions too... I'll have to check to refresh my memory.

-Steve

Re: Modules are not working

PostPosted: Mon Feb 04, 2013 2:03 pm
by jerryevo
Just check in documentation :lol:

Seems that both notations work.