Yii Framework Forum: An idea for Role Based Access Control - Yii Framework Forum

Jump to content

  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • This topic is locked

An idea for Role Based Access Control Rate Topic: -----

#21 User is offline   Anticon 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 25-February 09
  • Location:Germany

Posted 10 March 2009 - 03:30 AM

Quote

Quote

Edit:

Attached blog demo from Yii 1.0.3 with Rbac.


There may be name mismatch between the table and the code. Error message says

Quote

The table "Post" for active record class "Post" cannot be found in the database.
while the schema shows

Quote

DROP TABLE IF EXISTS `post`;

CREATE TABLE IF NOT EXISTS `post` (

  `id` int(11) NOT NULL auto_increment,

  `title` varchar(128) NOT NULL,

  `content` text NOT NULL,

  `contentDisplay` text,

:

I've created it with a XAMPP. It seems that the phpmyadmin of it automatically changes the tablenames to lowercase. This is no problem on Windows but on Linux it produces the the encountered errors. This is evil.

You have to to change tablenames in the models to get it work: Post -> post, PostTag -> posttag, etc. I will try to fix in the zip-file the next days.

For further information take a look at:
http://dev.mysql.com...ensitivity.html
0

#22 User is offline   qwerty 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 290
  • Joined: 20-November 08

Posted 10 March 2009 - 04:30 AM

Hi,
in my database I have table "user". RBAC extension use "users".
So, what I have to do use this extension? Is it possible to do with no update my table name?

Thanx!
0

#23 User is offline   Wallworth 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 12-March 09
  • Location:Johannesburg

Posted 12 March 2009 - 11:14 AM

You will have to edit
Rbac.php
RbacCommand.php
and the database constraint that points to the users table.

It shouldn't take that long but probably a bit longer than renaming the table.

0

#24 User is offline   Bios Element 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 63
  • Joined: 13-February 09
  • Location:Ohio, USA

Posted 12 March 2009 - 10:05 PM

Quote

You will have to edit

Rbac.php

RbacCommand.php

and the database constraint that points to the users table.



It shouldn't take that long but probably a bit longer than renaming the table.


Actually he won't. Here's a pack that should work nicely for you. Now this has NOT been prepared for release so there's probably some random stuff I was working on mixed in but you can just pick and choose files. The SQL file I packed will get you started but you'll have to add the admin/password user and all the permissions.

Also I was mid-way through with a profile system which you'll also probably want to rip out. But if you just want the SQL and RBAC files they're in there for ya.

http://www.easy-shar...32/Yii_RBAC.zip
0

#25 User is offline   qwerty 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 290
  • Joined: 20-November 08

Posted 13 March 2009 - 12:31 AM

thanx, but I think that should be configuration file for this.
0

#26 User is offline   mocapapa 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 428
  • Joined: 04-January 09
  • Location:Tokyo, JAPAN

Posted 13 March 2009 - 02:03 AM

I have been chasing the description of the the extension one by one.

Quote

start adding roles and permissions with the rbac shell command, e.g. run ./protected/yiic shell to enter running shell and then issue rbac command to get its help.


It is strange but nothing had happened when I entered the command as follows.

Quote

$ protected/yiic shell


I copied yiic from the existing application such as blog demo, but no success. :'( Does anyone know the reason?

[EDIT]
Before inserting filter method in the SiteController, yiic shell works (waits for me at least).

Quote

public function filters()

{

  return array(

    array(

            'application.filters.RbacFilter',

          ),

  );

}


0

#27 User is offline   qwerty 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 290
  • Joined: 20-November 08

Posted 13 March 2009 - 03:01 AM

Hi,
I have the same problem in my site when I have to login to show index page.
0

#28 User is offline   jjmf 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 60
  • Joined: 10-November 08

Posted 18 March 2009 - 03:06 PM

Quote

In a week or so I'm going to upload heavily modified code. It will be a configurable Yii module, with own login/logout/signup/passwordForgot features and admin interface for managing roles, permissions and users.


How is it going with the yii module?
0

#29 User is offline   oleksiy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 24-February 09

Posted 19 March 2009 - 03:10 AM

Few changes left :)

Quote

How is it going with the yii module?

0

#30 User is offline   megabr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 142
  • Joined: 23-March 09
  • Location:Brazil

Posted 23 March 2009 - 03:31 PM

first thanks for helping exnding this framework...

I am thinking use you auth extension with module roles link an CMS...

can your system build permissions based on module acesse roles?
like

/modules/forum
/modules/chat
....etc



Any comments are wellcome


regards


Max
0

#31 User is offline   oleksiy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 24-February 09

Posted 23 March 2009 - 03:39 PM

Hi!

Yes, I will soon upload the version that fully supports modules.
0

#32 User is offline   megabr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 142
  • Joined: 23-March 09
  • Location:Brazil

Posted 23 March 2009 - 04:13 PM

can I help building anything?
(debuging, beta testing before upload)

:)

regards



0

#33 User is offline   mrballcb 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 26-March 09

Posted 26 March 2009 - 09:13 AM

Quote

can I help building anything?

(debuging, beta testing before upload)


I would also like to volunteer to help test and debug anything, though I admit that I'm not a php guru.
By any chance is this module available in a git repo?
Do you or anybody who uses/develops/tests this module hang out on IRC?
0

#34 User is offline   megabr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 142
  • Joined: 23-March 09
  • Location:Brazil

Posted 26 March 2009 - 09:44 AM

you can test a full user autentication from db, with users and groups, here with a generic auth class buildin in YII

http://www.yiiframew...opic,799.0.html

(of couser this is a gereric not modular)
0

#35 User is offline   megabr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 142
  • Joined: 23-March 09
  • Location:Brazil

Posted 29 March 2009 - 01:20 PM

oleksiy,

exist any chance this extension migrate under YII modules dir like

/modules/userscontrol/

regards

Max
0

#36 User is offline   oleksiy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 24-February 09

Posted 30 March 2009 - 03:19 AM

Hi Max,

I've made a small cutoff of the project we are working on now. It contains RBAC as module, with a complete login/logout/register/password_forgot feature and some additional models/controllers.

You may need to change mail server settings in main.conf in order to send emails.

You may also try and test my ajax dialogs and forms, BaseAdminController which implements them together with any deep level of relations sorting and filtering - have a look at adminAttributes() method in /protected/models/*

link to file: http://luckyteam.co....mp/rbactest.zip
0

#37 User is offline   Bios Element 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 63
  • Joined: 13-February 09
  • Location:Ohio, USA

Posted 30 March 2009 - 12:32 PM

Quote

Hi Max,



I've made a small cutoff of the project we are working on now. It contains RBAC as module, with a complete login/logout/register/password_forgot feature and some additional models/controllers.



You may need to change mail server settings in main.conf in order to send emails.



You may also try and test my ajax dialogs and forms, BaseAdminController which implements them together with any deep level of relations sorting and filtering - have a look at adminAttributes() method in /protected/models/*


Not sure you wanted to post your entire project file. Might want to remove some of that. But regardless, It's very interesting to read through.
0

#38 User is offline   oleksiy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 24-February 09

Posted 30 March 2009 - 01:03 PM

Thats not the whole project file, its a really short cutoff :) Just to demonstrate how one can connect users with logins (RbacLogin) and some examples with my BaseAdminController.
0

#39 User is offline   oleksiy 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 24-February 09

Posted 30 March 2009 - 01:05 PM

RBAC is completely separated there in the /modules/rbac folder. Beside for BaseAdminControler, BaseAdminFilter, RbacFilter class and Rbac component.
0

#40 User is offline   megabr 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 142
  • Joined: 23-March 09
  • Location:Brazil

Posted 30 March 2009 - 01:31 PM

oleksiy,

Thanks for share this project

realy Nice;

I am try working in similar project...

are you know xoops cms? http://www.xoops.org

this cms have a beatufully OO user/groups management, maby we can import the usability to RBAC

changing 'block' for 'actions'
..

:)


Attached File(s)

  • Attached File  group.gif (90.14K)
    Number of downloads: 70

0

Share this topic:


  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • This topic is locked

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