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

Jump to content

  • (38 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • 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

#61 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 05 September 2009 - 12:27 AM

View PostSpyros, on 03 September 2009 - 09:28 AM, said:

First create the operations/roles in the /index.php?r=srbac/authItem/manage/manage page and then assign them to your users


yes spyros
i have created operations/roles and assigned to users
then what i have to do using this
what is the use of your module
please explain
0

#62 User is offline   Spyros 

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

Posted 05 September 2009 - 01:31 AM

View Postmurugan, on 05 September 2009 - 12:27 AM, said:

yes spyros
i have created operations/roles and assigned to users
then what i have to do using this
what is the use of your module
please explain


You have to check if the current user has access to the page in your controllers
read here http://www.yiiframew...ide/topics.auth
To perform access checking, we first need to know the name of the authorization item. For example, to check if the current user can create a post, we would check if he has the permission represented by the createPost operation. We then call CWebUser::checkAccess to perform the access checking:

if(Yii::app()->user->checkAccess('createPost'))
{
    // create post
}

0

#63 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 05 September 2009 - 03:20 AM

Thanks spyros
now i am following your instructions
0

#64 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 05 September 2009 - 05:53 AM

Thanks spyros
Perfectly well
Super creation
All are works
Thanks again
0

#65 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 06 September 2009 - 05:36 AM

Hi spyros
how to set how much time an user can login without any operation for authentication
0

#66 User is offline   Spyros 

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

Posted 06 September 2009 - 01:04 PM

View Postmurugan, on 06 September 2009 - 05:36 AM, said:

Hi spyros
how to set how much time an user can login without any operation for authentication

I don't understand your question.
0

#67 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 06 September 2009 - 11:33 PM

when i logon to my application then i did nothing then when it expires my logon account
0

#68 User is offline   Spyros 

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

Posted 07 September 2009 - 01:14 AM

View Postmurugan, on 06 September 2009 - 11:33 PM, said:

when i logon to my application then i did nothing then when it expires my logon account

This has to do with your login system
If you use cookies or session set the time out in your login script
0

#69 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 569
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 08 September 2009 - 10:13 AM

Very nice!

I got it working, as a nested module! But, this was just a test.

I had to tweak the code a little bit.
Some lines refer directy to the module srbac, which breaks the code, when using it a as nested module:
Yii::app()->getModule('srbac')


I also posted an issue here:
http://www.yiiframew...-nested-module/

If you have an idea how to fix this, it would be great!

Best regards,
schmunk
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#70 User is offline   Spyros 

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

Posted 09 September 2009 - 12:14 AM

I think a Yii:app()->findModule('moduleID') that will search all child modules of App would be handy.
I don't know if such a function exists so I made one.
I attach a version that's only tested as
app/modules/srbac
and
app/modules/parent/modules/srbac
and it seems to work.
But because my parent module is a fake one please test it with yours.
Thanks

Attached File(s)


0

#71 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 569
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 09 September 2009 - 08:41 AM

ευχαριστώ!

View PostSpyros, on 09 September 2009 - 12:14 AM, said:

I think a Yii:app()->findModule('moduleID') that will search all child modules of App would be handy.

I think this would be a cool feature, think about posting a ticket.


View PostSpyros, on 09 September 2009 - 12:14 AM, said:

and it seems to work.

And so it does! :rolleyes: Release it!

Two more things:

First, srbac throws a few notices, it would be nice if either you could debug them or, as a workaorund, if you could add this line:
<?php

error_reporting(E_ALL ^ E_NOTICE);

class SrbacModule extends CWebModule {

to the SrbacModule.

And, second, loading indicators would be also very nice:
http://www.yiiframew...oc/cookbook/46/


Best regards,
schmunk
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#72 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 569
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 09 September 2009 - 09:40 AM

btw there's already a findModule() method: http://www.yiiframew...ndModule-detail
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#73 User is offline   Spyros 

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

Posted 09 September 2009 - 09:59 AM

View Postschmunk, on 09 September 2009 - 09:40 AM, said:

btw there's already a findModule() method: http://www.yiiframew...ndModule-detail

Yes I didn't know it.
But
"...Searches for a module by its ID. This method is used internally. Do not call this method."

About the notices I thought I fixed them all but it seems that some are not fixed.
Do you have the errors it threw?

The ajax indicators is something that I was thinking about today :)

Thanks
0

#74 User is offline   horizons 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 123
  • Joined: 18-December 08

Posted 11 September 2009 - 04:28 AM

Hi I also tried to install this extension in my application.
But I have a problem with it :S

srbac/authItem/assign works perfectly
but
srbac/authItem/manage
crashes my whole layout of my page.
I have several js imports in my layout/main.php also I register jquery as core script (cause its used on every page,layout, menue etc).
$cs->registerCoreScript('jquery');

When i now have some code like below which comes from the autitem/manage/list.php
 $this->widget('CAutoComplete',
       array(
       'name'=>'name',
       'max'=>10,
       'delay'=>300,
       'matchCase'=>false,
       'url'=>array('autocomplete'),
       'minChars'=>2,
       )
   );

It seems that jquery is requested 2 times in my html code.
One on the top and the other on the bottom. Which them creates a JS error and makes any jquery code unuseable.

Part of the code generated by your extension.
 ...
     <div id="list" class="list">
        <link rel="stylesheet" type="text/css" href="/yii/testdrive5/assets/6f368e91/srbac.css" />
<link rel="stylesheet" type="text/css" href="/yii/testdrive5/assets/175f3f8b/autocomplete/jquery.autocomplete.css" />
<link rel="stylesheet" type="text/css" href="/yii/testdrive5/assets/2dc5f90a/pager.css" />
<script type="text/javascript" src="/yii/testdrive5/assets/175f3f8b/jquery.js"></script>
<script type="text/javascript" src="/yii/testdrive5/assets/175f3f8b/jquery.bgiframe.js"></script>
<script type="text/javascript" src="/yii/testdrive5/assets/175f3f8b/jquery.dimensions.js"></script>

<script type="text/javascript" src="/yii/testdrive5/assets/175f3f8b/jquery.ajaxqueue.js"></script>
...

Seems it doesn't see that jquery is already imported as core script.

How can i fix this issue?

edit:
if i change the code in views\authItem\manage\manage.php

from:
   <?php echo $this->renderPartial('manage/list', array(
        'models'=>$models,
        'pages'=>$pages,
        'sort'=>$sort,
        'images'=>$images
        ), false, true); ?>
to:
<?php echo $this->renderPartial('manage/list', array(
        'models'=>$models,
        'pages'=>$pages,
        'sort'=>$sort,
        'images'=>$images
        )); ?>

It works. Is the processOutput really needed? Or do I have some coding issues in My Code?

Another problem is that it seems your are using $_REQUEST['id'] in your loadAuthItem function. Which seems not to work if you are using path urlManager with RewriteRule per .htacess is there anything I can do against this? Other then using $_GET or $_POST instead of $_REQUEST?
  'urlManager' => array(
        'urlFormat' => 'path',
        'showScriptName' => false,
    ),

regards Horizons
0

#75 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 569
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 13 September 2009 - 09:41 AM

Feature Request: Please make CSS configurable.

line 32, SrbacModule:
$css =  dirname(__FILE__).'/css/srbac.css';

I think it's the best to use a path relative to Yii::app()->basePath, like
$css =  Yii::app()->basePath.$this->params['cssFile'];


What do you think?

Best regards,
schmunk

PS: This would also be nice for CTabView ;)
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#76 User is offline   Spyros 

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

Posted 13 September 2009 - 10:30 AM

View Postschmunk, on 13 September 2009 - 09:41 AM, said:

Feature Request: Please make CSS configurable.

line 32, SrbacModule:
$css =  dirname(__FILE__).'/css/srbac.css';

I think it's the best to use a path relative to Yii::app()->basePath, like
$css =  Yii::app()->basePath.$this->params['cssFile'];


What do you think?

Best regards,
schmunk

PS: This would also be nice for CTabView ;)


Yes that would be nice
I'll add in the next version (along with the other changes discussed previously)
0

#77 User is offline   schmunk 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 569
  • Joined: 02-November 08
  • Location:Stuttgart, Germany

Posted 13 September 2009 - 10:50 AM

Great!

Please also add a LICENSE file.
I wanna redistribute srbac as a submodule of pii ... and just as a matter of form, I am German, you know ::)

Btw, here are some more of my thoughts regarding modules:
http://www.yiiframew...-default-style/
Phundament - Yii Application Boilerplate with composer support
Fork on github

Follow phundament on Twitter

DevSystem: Mac OS X 10.7 - PHP 5.3 - Apache2 - Yii 1.1 / trunk - Firefox or Safari
0

#78 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 16 September 2009 - 07:18 AM

Hi spyros
i created Super User,student,staff,parent,adminstaff as user types
Super User is the authority

i created two Super User but my module accepts only one Super User (first one) to do all works
and another one Super User has no permissions why?

how many users can be Super User?
i need more than 1
0

#79 User is offline   Spyros 

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

Posted 16 September 2009 - 10:57 AM

View Postmurugan, on 16 September 2009 - 07:18 AM, said:

Hi spyros
i created Super User,student,staff,parent,adminstaff as user types
Super User is the authority

i created two Super User but my module accepts only one Super User (first one) to do all works
and another one Super User has no permissions why?

how many users can be Super User?
i need more than 1


You Created 2 users with the same name (Super User)?
Or you created 2 users and assigned to them the Super User role?
Or you created 2 users and assigned to them the Authority role?
0

#80 User is offline   murugan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 12-June 09
  • Location:Chennai,India

Posted 16 September 2009 - 11:46 PM

View PostSpyros, on 16 September 2009 - 10:57 AM, said:

You Created 2 users with the same name (Super User)?
Or you created 2 users and assigned to them the Super User role?
Or you created 2 users and assigned to them the Authority role?

i created 2 users and assigned to them the Super User role(Authority)

i now find the problem since my user table has
user_ID,username,password,email,staffid,studentid,parentid
in userIdentity class
i used getId() method to return staffid or studentid or parentid which has value
this is created that problem
now i changed to return only user_ID
that clears all my problem
Sorry for wasting your golden time
0

Share this topic:


  • (38 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • 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