php - Cakephp 2.x Stuck with Auth component with different models -
i'm coding app car selling, i'm stucked auth component. have 3 kind of access:
admin: app owner dealers: owners of car dealers user: people whach car offers , make questions etc
i'm not working roles, ech 1 (admin, dealer , users) has username , password diferent models, i'm lost.
i'm not asking codes, wanna explanation how can deal auth assuming scenario.
well it's matter of allowing/denying access user. if can recognize users model in controllers beforefilter method, can allow/deny access accordingly $this->auth->allow()
or $this->auth->deny()
(in beforefilter method). maybe can put pseudo-role in session after login if don't wish have in db table. can put auths allow/deny in conditions on pseudo-role stored in session.
or have misunderstood question?
update
i realized refering actual login. changing default model documented in cookbook. see usermodel
configuration key. keep in mind supposed change in beforefilter method.
Comments
Post a Comment