Rails 3 Dynamic User Roles/Access Levels

I'm developing an application that will be used by teachers to manage student assignments and submissions. However, different schools have different standards for assignment submissions, grades, what students should and shouldn't be able to do. As such, I was looking to implement some flexible role management functionality into my application so that the teachers can decide exactly what privileges the user should and shouldn't be able to perform.

One quick solution to this might be to simply add some boolean fields to my User model that the teachers can manipulate by way of check-boxes and run a before_filter on the pertinent controller actions. Alternatively I could move the role definitions to a separate model belonging to the teachers and run the before_filter on that.

Before I try to implement either of those solutions I was wondering if there were any gems or plug-ins that already handle flexible user-managed role definitions?

Just as a side-note I'm using Devise for my authentication if that means anything.

Answers


I found this gem quite useful. https://github.com/EppO/rolify And it has a way of easy integration with Devise and CanCan https://github.com/EppO/rolify/wiki/Tutorial


Need Your Help

Bluetooth iOS Pairing

ios objective-c bluetooth

I have a fitness app that is already in the app store and now I want to implement a bluetooth device that users can purchase if they wish. This is my first time dealing with bluetooth and after rea...

Setting style for only one kind of widget

c++ qt

How can I globally change the style of one specific type of widget? I want to make all QGroupBox instances use the "plastique" style because of that nice border:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.