Modules are not working

A place to discuss development of the Xataface core.

Modules are not working

Postby jerryevo » Mon Jan 28, 2013 2:19 pm

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?
jerryevo
 
Posts: 16
Joined: Sun Jan 06, 2013 1:30 pm

Re: Modules are not working

Postby jerryevo » Fri Feb 01, 2013 3:34 am

Any ideas?
jerryevo
 
Posts: 16
Joined: Sun Jan 06, 2013 1:30 pm

Re: Modules are not working

Postby shannah » Mon Feb 04, 2013 9:51 am

What does your getPermissions() method look like?
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Modules are not working

Postby jerryevo » Mon Feb 04, 2013 12:41 pm

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"
jerryevo
 
Posts: 16
Joined: Sun Jan 06, 2013 1:30 pm

Re: Modules are not working

Postby shannah » Mon Feb 04, 2013 12:50 pm

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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Modules are not working

Postby jerryevo » Mon Feb 04, 2013 12:55 pm

I will try to check it.

It is clear that such great product have to had updated documentation :D
jerryevo
 
Posts: 16
Joined: Sun Jan 06, 2013 1:30 pm

Re: Modules are not working

Postby jerryevo » Mon Feb 04, 2013 1:39 pm

OK, seems to work!

There was need to update actions.ini file too

[ADMIN > ADMIN] is the same as [ADMIN extends ADMIN]?
jerryevo
 
Posts: 16
Joined: Sun Jan 06, 2013 1:30 pm

Re: Modules are not working

Postby shannah » Mon Feb 04, 2013 2:00 pm

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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Modules are not working

Postby jerryevo » Mon Feb 04, 2013 2:03 pm

Just check in documentation :lol:

Seems that both notations work.
jerryevo
 
Posts: 16
Joined: Sun Jan 06, 2013 1:30 pm


Return to Xataface Developers

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved