Yii Framework Forum: is it possible that run srbac on two use tables - Yii Framework Forum

Jump to content

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

is it possible that run srbac on two use tables Rate Topic: -----

#1 User is offline   Boy.Lee 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 105
  • Joined: 03-September 10

Posted 16 November 2010 - 12:33 AM

Hi Spyros,

Recently, I am working on a project, and it use two tables for user authenticate, one is User table, another is Agency table. This is a site of student and agency, student can find train info from here, and The agency publish their course here.

Here is the question, the guy before me use two form for login, one is use another is agency, but I found srabc only can use on table for 'user', so I need your help.

Btw, The id of user and agency is not in the same format, user id like u_00001, agency id like a_00001.

The worse way is change DB put two table together and split difference into two table, and put the together table info srbac config.

anyway, thx.
Love Yii, Love BoyLee ^&^

Looking for Yii Project, if you have please PM me. :)

My Blog => YiiBlog.info
0

#2 User is offline   Spyros 

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

Posted 16 November 2010 - 01:43 AM

It's not possible to use two or more tables since srbac loads the user model to assign roles.
Two tables mean two models so that will be a problem
I'll try to think of a way to solve this problem like having the two models extend a base user model (with only the id, username attributes) and use this base user model as the srbac user or something like that
0

#3 User is offline   Boy.Lee 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 105
  • Joined: 03-September 10

Posted 17 November 2010 - 12:25 AM

the main reason for me to post this out is find a way to solve this ,and I thought that if make a base class for srbac and a default class extend from it, and make it like today's srbac, and give user ability to make another extend class is awesome.

anyway thanks for you reply, and hoping hear good news from you.
Love Yii, Love BoyLee ^&^

Looking for Yii Project, if you have please PM me. :)

My Blog => YiiBlog.info
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