Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Users, Groups, Pages and Permissions
Shilo Ayalon
3/5/2009 2:03:00 PM
Hi - what I'm trying to accomplish is to enable different levels of
access to users in my application. The models are here:
http://pastie....
Basically, the permission model holds the group_id, page_id and
read/write permission as boolean. If a certain user from some group is
trying to access a page, he can do it if his group_id has can_read =
true for the specific page_id. He can then edit the page if he has
can_edit = true.
This got a little (very) complex to manage since I need to add and deny
permissions for every group on every page, and also need to use a
before_filter or some sort of <% if current_user.can_read(page_id) %> at
the beginning of each action.
I'm looking for suggestions on how to simplify this system while still
retaining it's original functionality (ie - allow or deny user's access
to pages based on the group he belongs to). The less code in the
controller - the better :)
thanks.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Users, Groups, Pages and Permissions
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password