Yii Framework Forum: [EXTENSION] srbac : Web interface for the administration of rbac - Yii Framework Forum

Jump to content

  • (38 Pages)
  • +
  • « First
  • 32
  • 33
  • 34
  • 35
  • 36
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] srbac : Web interface for the administration of rbac Rate Topic: ****- 7 Votes

#661 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 01 October 2010 - 03:34 PM

View PostJuan Pablo Sala, on 01 October 2010 - 02:40 PM, said:

Hi, I may be wrong, but it seems that now some items are created with $id at the end.
My fix was to append this:
if (in_array($access.'$id', $this->allowedAccess())) {
return true;
}
in the beforeAction.

Thanks for your excellent work!!

This happens because of a change in 1.1.4 (automatic action parameter binding)
I should fix it in SVN soon
0

#662 User is offline   coma 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 19-July 10

Posted 04 October 2010 - 03:14 AM

Heya, I have a problem.
I've installed srbac on my second application, seemed to retrace all the steps I did in the first, checked with manual but it doesn't do the user->checkAccess(). My single user is assigned an admin role, under which the srbac should be available. But even that doesn't work once I turn off the debug mode... :(

I have my controller extended from SBaseController, in the config I have this:

'import'=>array(
	'application.models.*',
	'application.modules.srbac.controllers.SBaseController',        
	'application.components.*',
	'application.extensions.*',
        'application.modules.srbac.components.*',
),

   'modules'=>array(
       'srbac' => array (
		'userclass'=>'Users', //optional defaults to User
		'userid'=>'usr_id', //optional defaults to userid
		'username'=>'usr_username', //optional defaults to username
		'debug'=>false, //optional defaults to false
		'pageSize'=> 30, //optional defaults to 15
		'superUser' =>'admin', //optional defaults to Authorizer
		'css'=>'srbac.css', //optional defaults to srbac.css
		'layout'=>'application.views.layouts.main', //optional defaults to
		// application.views.layouts.main, must be an existing alias
		'alwaysAllowed'=>array( //optional defaults to gui
			'SiteLogin','SiteLogout','SiteIndex',
			'SiteError', 'SiteContact'
		),
		'userActions'=>array(//optional defaults to empty array
			'Show','View','List'
		),
		'listBoxNumberOfLines' => 30,
		'alwaysAllowedPath'=>'srbac.components', //optional defaults tosrbac.components
		// must be an existing alias
        ),
    ),

    components (
       'db'=>array(
            'class'=>'system.db.CDbConnection',
			'connectionString' => 'mysql:host=localhost;dbname=vpn',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '123456',
			'charset' => 'utf8',
            'enableProfiling' => true,
		),

        'authManager'=>array(
            // The type of Manager (Database)
            'class'=>'CDbAuthManager',
            // The database component used
            'connectionID'=>'db',
            // The itemTable name (default:authitem)
            'itemTable'=>'items',
            // The assignmentTable name (default:authassignment)
            'assignmentTable'=>'assignments',
            // The itemChildTable name (default:authitemchild)
            'itemChildTable'=>'itemchildren',
            'defaultRoles'=>array('guest'),
        ),

    ),

0

#663 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 04 October 2010 - 03:40 AM

Is srbac installed successfully?
Which version of Yii do you use?
0

#664 User is offline   coma 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 19-July 10

Posted 04 October 2010 - 05:20 AM

View PostSpyros, on 04 October 2010 - 03:40 AM, said:

Is srbac installed successfully?
Which version of Yii do you use?


Yes it installed without any errors, and I use the latest Yii in SVN.
0

#665 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 04 October 2010 - 09:54 AM

It must be the same bug with the previous post (auto param binding in yii.1.1.4)
I fixed it but I can't commit it to svn now
Check if your auto created auth items have the $id or something like that in the end
Then make this change in AuthItemController.php
line 716
from:
<?php 
   $action = trim(substr($line, strpos($line, "action")));
    	$patterns[0] = '/\s*/m';
    	$patterns[1] = '/\(/m';
    	$patterns[2] = '/\)/m';
    	$patterns[3] = '/\{/m';
    	$replacements[2] = '';
    	$replacements[1] = '';
    	$replacements[0] = '';
    	$action = preg_replace($patterns, $replacements, trim($action));
?>


to:
<?php 
  $action = trim(substr($line, strpos($line, "action")));
    	$patterns[0] = '/\s*/m';
    	$patterns[1] = '#\((.*)\)#';
    	$patterns[2] = '/\{/m';
    	$replacements[2] = '';
    	$replacements[1] = '';
    	$replacements[0] = '';
    	$action = preg_replace($patterns, $replacements, trim($action));
?>

0

#666 User is offline   coma 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 19-July 10

Posted 04 October 2010 - 10:34 AM

View PostSpyros, on 04 October 2010 - 09:54 AM, said:

It must be the same bug with the previous post (auto param binding in yii.1.1.4)
I fixed it but I can't commit it to svn now
Check if your auto created auth items have the $id or something like that in the end


This is not it :(
Though I had that problem too, I was fixing it manually, so still thanks..
But that doesn't resolve my problem.
And srbac works fine on my first project. Doesn't work on this one...
Still I think I might be missing something, some configuration. Though I double-triple checked the values,
the configuration file parts are identical. The Controller class extended correctly.. Was there something else?
0

#667 User is offline   coma 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 19-July 10

Posted 12 October 2010 - 02:53 AM

I seem to have found the problem, but I can't find how to fix it..

Yii::app()->user->getId() returns username for some reason.

Any suggestions?
0

#668 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 12 October 2010 - 03:05 AM

This is the default behavior for Yii::app()->user
check here:
http://www.yiiframew...ide/topics.auth

Quote

We also override the getId method to return the _id variable which is set during authentication (the default implementation would return the username as the ID).

0

#669 User is offline   coma 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 19-July 10

Posted 12 October 2010 - 04:10 AM

Tnx! Finally fixed everything... I missed the overriding function! :)
0

#670 User is offline   Nikeware 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 20-July 10

Posted 12 October 2010 - 08:08 AM

I have problem with srbac (1.1.1 r209) in IE.
When I try click on User list in Users tab, "Assigned Roles" and "Not Assigned Roles" list boxes is empty. The are similar situation in Roles and Tasks tabs also.

p.s. In Firefox and Opera it work fine.

Thank you,

Nikolai
0

#671 User is offline   42ii 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 18-October 10

Posted 18 October 2010 - 11:27 AM

Hi Spyros!

Thanks for your great work!

As a newbie I ran in a very stupid problem:

Alias "modules.srbac.components.SDbAuthManager" is invalid. Make sure it points to an existing directory or file.

This was easy fixed by typing "application.modules.srbac.components.SDbAuthManager" instead.

Maybe you can correct the srbac guide.
1

#672 User is offline   macinville 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 268
  • Joined: 25-October 10
  • Location:Marikina City, Philippines

Posted 25 October 2010 - 01:14 PM

Thanks so much Spyros for this wonderful extension. This is only my 9th hour studying Yii framework and I have to say your extension rocks. :)

Earlier I experienced the error "Property "CWebApplication.authManager" is read only." , and found out that my authManager is outside the components array. My apologies if this was already pointed out, just wanted to help other newbies with this same problem.

More power man!
Tell your tail.
Don't be shy to upvote a post if it was able to help you
0

#673 User is offline   disccomp 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 18-October 10

Posted 26 October 2010 - 10:40 PM

Bug: Table name prefixes are not honored when tables are generated.
0

#674 User is offline   simplicissimus 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 01-September 10

Posted 02 November 2010 - 10:53 AM

Thank you for the extension.

Unfortunately, I cannot find a hint in the documentation, neither in the code how to configure srbac autocreate authitems to create items for my standard controllers and theit actions. My controllers are in the normal application/protected/controllers directory.
When pressing the button autocreate, the resulting table looks like (where Controllers and Actions is emtpy. The only results are the SRBAC controllers):

Controller Actions
Module: srbac
AuthitemController
SBaseController
Can anyone help?
0

#675 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 04 November 2010 - 12:24 AM

I guess that your controllers extend Controller (found in components dir).
Just make Controller extend SbaseController and not CController
0

#676 User is offline   simplicissimus 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 01-September 10

Posted 04 November 2010 - 10:20 AM

Thank you for your answer. I figured that out too this morning, by studying your code. Unfortunately (at least for my understanding) the srbac docu guide reads like you have to extend the SBaseController only if you want to have automatic access check (and not autocreation).
0

#677 User is offline   ignition25 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 25-November 10

Posted 01 December 2010 - 06:56 PM

Demo link seems to be down?

include_once(/~/www/spyros.agilityhoster.com/demos/protected/modules/srbac/controllers/AuthItemController.php/../SBaseController.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory
0

#678 User is offline   Juan Calvo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 04-December 10
  • Location:EspaƱa

Posted 04 December 2010 - 08:31 PM

Would it cost much to create some examples of how to implement it correctly?

In other extensions, it explains in detail how to do it step by step, why not this extension?

There are many people interested in this extension.

Greetings
1

#679 User is offline   mjkulet 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 82
  • Joined: 03-November 10

Posted 10 December 2010 - 08:23 AM

There is an error I encountered when I used the latest srbac(srbac_1.1.1_r209). I encountered this during an update and adding an operation (see images attached).

What I really want to say is, I hope there's a newbie-friendly documentation for this (new to rbac logic at least). I find this extension very promising, and I think it will gain more audience if can it reach out to yii professionals wannabe (in which I think I belong :D)

More power to SRBAC!

Attached File(s)


0

#680 User is offline   mrwallace 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 12-September 10

Posted 24 December 2010 - 02:27 AM

I've translated the latest el_gr messages file to Dutch (nl/nl_be/nl_nl).
You can download the tar file here.
Retreat is no longer an option...
0

Share this topic:


  • (38 Pages)
  • +
  • « First
  • 32
  • 33
  • 34
  • 35
  • 36
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users