So a while ago (page 24) I was having a problem where I couldn’t see the always allowed GUI. I fixed this by setting my config to ‘alwaysAllowed’=>‘gui’, and it worked fine. It suddenly stopped working again, and I have no idea why. Here’s my configuration info:
'srbac' => array(
'userclass'=>'user', //optional defaults to User
'userid'=>'user_oid', //optional defaults to userid
'username'=>'email', //optional defaults to username
'debug'=>true, //optional defaults to false
'pageSize'=>10, //optional defaults to 15
'superUser' =>'Authority', //optional defaults to Authorizer
'layout'=>'application.views.layouts.main', //optional defaults to empty string
// must be an existing alias
'alwaysAllowed'=>'gui',
'userActions'=>array(//optional defaults to empty array
'Show','View','List'
),
'listBoxNumberOfLines' => 15, //optional defaults to 10 'imagesPath' => 'srbac.images',
//optional defaults to srbac.images 'imagesPack'=>'noia',
//optional defaults to noia 'iconText'=>true,
//optional defaults to false 'header'=>'srbac.views.authitem.header',
//optional defaults to srbac.views.authitem.header, must be an existing alias
//'footer'=>'srbac.views.authItem.footer', //optional defaults to
// srbac.views.authitem.footer, must be an existing alias 'showHeader'=>true, //optional defaults to false 'showFooter'=>true, //optional defaults to false
'alwaysAllowedPath'=>'srbac.components', //optional defaults to srbac.components
// must be an existing alias
),
Any ideas as to what’s going on? I updated to the latest version 1.1.0.3, and still have the same problem.
Yes… oddly enough, it was for another separate module that wasn’t properly configured (in config, I was trying to import it from the modules folder, but it wasn’t in the modules folder anymore). For some reason, that caused the one page in the SRBAC module to bug out, even though everything else was fine.
Not quite a bug, just a peculiar counter-intuitive behavior…
array(
...
"css"=>"srbac[s]_red[/s].css", // must be in srbac css folder
//The layout to use
"layout"=>"application.views.layouts.[s]admin[/s]main",
//The not authorized page to render when a user tries to access an page
//tha he's not authorized to
"notAuthorizedView"=>"application.views.site.[s]unauthorized[/s]error",
...
I have suggestion to create interface for controllers classes (and maybe modules) that would add for example getSrbacNames() method, which would return custom names for actions. For example:
Controller accounts in module users , could have something like that:
class Accounts extends CController
{
//...
public function getSrbacNames()
{
return array('name'=>'Users: Accounts.','actions'=>array('index'=>'ListUsers','login'=>'Login user'));
}
//..
}
It has two main benefits, more user friendly names can be created and it is possible to make multi-lingual names for actions in srbac.
I have problem with installation. Everything is green, when I press install i get message that installation is successful, but when I click go to front page I am redirected to installation page.
This means that srbac doesn’t find the auth tables in the database. Check the if the names of the tables are the same as entered in srbac config (case sensitive - lower case)
I have another question. I have login action and in controller accounts, which is in module Users. I wanted to assign this action to notAuthorizedView, but I get error. Is it possible to assign action instead of view only?