CantangoEditor
Cantango Editor is a Rails mountable Engine providing web-interface for editing CanTango gem's permissions for any Rails 3 app.
What it does
It is no more than a nice-looking wrapper interface which is used for editing permissions stored in special yaml file: default is a config/permissions.yml. See "Yaml Permissions store" section on Permissions for more details.
Installiation
Prerequisites
CantangoEditor assumes that you're on Rails 3.1 and using CanTango gem with Permission engine enabled
Not a Gem yet
include in Gemfile:
gem 'cantango_editor', :git => "git://github.com/stanislaw/cantango_editor.git"
bundle update
Set up models, types, groups and actions you're gonna have in your app
To understand Cantango's permission_engine's options better please see wiki on Cantango's Permissions.
Create file cantango_editor.rb in config/initializers and write there:
CantangoEditor.configure do |config|
config.permission_types_available = [:roles, :user_types]
config.permission_groups_available = { :roles => [:guest, :user], :user_types => [:admin] }
config.models_available = config.models_default - [Admin, CustomSession]
config.actions_available = config.actions_default | [:write, :assign_roles]
end
And mount CantangoEditor somewhere in your app:
mount CantangoEditor::Engine => "/cantango_editor"
Important note!
Cantango is heavily based on CanCan authorization system.
If you want to have good understanding of how Cantango's permissions rules work we recommend you to read carefully these sections from CanCan's wiki:
Todo:
- Interface for categories too
- As always more and better tests
- Remove 'dev notes' link ;)
Credits: