Giter Club home page Giter Club logo

cantango_editor's Introduction

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:

# Your_app's root/config/initializers/cantango_editor.rb
CantangoEditor.configure do |config|

  # Permission types to be displayed in interface
  # default: [:user_types, :account_types, :roles, :role_groups, :licenses, :users]
  config.permission_types_available = [:roles, :user_types] 

  # If you do not enumerate all permission_types here - 
  # those that are unmentioned here will just appear empty, having no permission_groups.
  # default: { :roles => [:admin, :user] }. 
  config.permission_groups_available = { :roles => [:guest, :user], :user_types => [:admin] }

  # default: all Models extracted from ActiveRecord's tables list
  config.models_available = config.models_default - [Admin, CustomSession]

  # Cancan's actions
  # default: [:create, :read, :update, :delete, :manage]
  config.actions_available = config.actions_default | [:write, :assign_roles]
end

And mount CantangoEditor somewhere in your app:

# Your_app's root/config/routes.rb

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:

cantango_editor's People

Contributors

kristianmandrup avatar stanislaw avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.