开发者

how should I render views when users habtm roles. cake

ok here is my issue...

user habtm groups(roles)

i have views for admins, boardmembers, managers, and vps.

so when an user have just one role the app reads the role and we're going fine... BUT when he/she/it have two or more roles it just take the first one and dissmiss the others...

the questions

  • how should i manage those role so the user can choose what view to see?
  • should i tell the user what role he wants to play after login? Ex: made him decide (want's to play admin, want's to play manager, etc)
  • is there a way the user can play two roles at the same time at one session? Ex: I have two roles (vps, manager). render two views in one?
  • or should i choose a view for that role that have more privilege? Ex: I have two roles (admin, manager)开发者_如何学运维 so i use admin views not the manager's ones.

a lot of questions... so start answering hahaha thanks guys...


It's difficult to answer because the sort of questions you're asking require us to decide how your application will work. You have to do that yourself and make appropriate design & programming based on your decision.

As for display of HABTM records, I usually use checkboxes or some graphical readonly equivalent.

My suggestion is that you look around the web to see how it works on other sites - social sites like Flickr and Facebook are a good hunting ground as they have lots of groups, categories etc.


user admin routing... and have many prefixes. and may be in the place where you display user information. you can also list the other roles he can play.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜