Subscribe to RSS Feed
Twitter
HIRE ME! home  archives  about  blogroll

Roleify, a rails authorization plugin

05 Jun 2009

Vandaag heb ik een paar updates gepushed naar de Roleify rails plugin.

Changes

Example

The initializer

Roleify::Role.configure("role_a", "role_b") do
  {
    :role_a => { :dashboard_issues =>  :all },
    :role_b => { :issues => "index" }
  }
end

So, role_a refers to a Dashboard::IssuesController and role_b refers to an IssuesController.

The Helper

module ApplicationHelper
  include Roleify::RoleifyableHelper
end

The View

<% allowed?(Roleify::Role::ROLE_A) do %>
  whatever you want for role_a eyes only
<% end %>

More info on GitHub.

blog comments powered by Disqus