# Users, Groups, Pages and Permissions

**URL:** <https://www.ruby-forum.com/t/users-groups-pages-and-permissions/162074>\
**Category:** Ruby\
**Created:** [March 5, 2009, 3:02pm UTC](https://www.ruby-forum.com/t/users-groups-pages-and-permissions/162074 "2009-03-05T15:02:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gte351s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@gte351s](https://www.ruby-forum.com/u/gte351s)\
**Post date:** [March 5, 2009, 3:02pm UTC](https://www.ruby-forum.com/t/users-groups-pages-and-permissions/162074/1 "2009-03-05T15:02:48Z")

</div>

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.org/408263](http://pastie.org/408263)

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.
