Yii Framework Forum: Database Setup For Users/members/roles - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Database Setup For Users/members/roles Rate Topic: -----

#1 User is offline   deian 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 25-March 13

Posted 25 March 2013 - 01:35 PM

Hi all,

I'm developing an website where i want guests/or public users (who aren't validated) to be treated as a special guest user without logging in. This would be one role of many, others being, unvalidated, banned, member, admin, etc etc. I've got three main tables linked to this usage, the sessions table, users table and the members table, session table works in that it stores a session via the yii barebones app, u've also made a member table who have more stores detail to the user table, which will have email address, username, password etc. The member table is foreign keyd to the users table via the userID and the session table is linked to the users table (remembering there is a public user that isn't a member) via the userID. Does this seem overkill?

I don't know enough about rbac and i've read up loads, but still fail to grasp. Can anyone confirm they get what I am trying to achieve? And think of a way forward for me?

Thanks,
Deian
0

#2 User is offline   Jorgee 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 22-March 13

Posted 25 March 2013 - 02:35 PM

From the first paragraph, you seem to want a defaultRole to all non-logged in users.

Secondly, about RBAC, the database schema is located at yii/web/auth/schema-mysql.sql

Then in your Controller you set up filters() with accessControl key.

After that, create accessRules() method and set the permissions, example:

array('deny','action' => 'someAction', 'users' => '?')
0

#3 User is offline   deian 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 25-March 13

Posted 26 March 2013 - 09:01 AM

Thanks for the reply, so i can implement those three tables, but how can that tie in with what i've already designed? or would I have to redesign a little?
Regards,D
0

Share this topic:


Page 1 of 1
  • 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