Para::Acl
This Para plugin adds a simple admin roles management system which allows you to change which kind of admins have access to which components.
Installation
Add this line to your application's Gemfile:
gem 'para-acl', github: 'para-cms/para-acl'
And then execute:
$ bundle
Or install it yourself as:
$ gem install para-acl
Usage
Use the install generator to copy the migrations, create the super admin role.
Note : the generator needs to update the database schema and insert data in your database to make all existing admins have the defaul Super Admin role. So migrations will be copied and automatically run.
$ rails g para:acl:install
Add the plugin to your config/initializers/para.rb
file :
config.plugins += [:acl]
Add a :acl_roles
component in your config/components.rb
:
component :acl, :acl_roles
Restart your server and access your new "Acl" component to manage roles and authorizations.
Deployment
When you deploy your app, you may need to reset admins privileges and reassign roles on your deployment environment.
All you need is to run the para:acl:authorize_admins
rake task, that'll
create the "Super Admin" role if it doesn't exist and assign that role to
all existing admin users.
For a production deployment, you'll run the following on your server :
rake RAILS_ENV=production para:acl:authorize_admins
Alternatively, you can manually create that role and assign the desired admin users to it from a remote rails console.
Disable authorization to debug or fix an error
You can disable the whole authorization system and allow for anybody to
access any component by configuring the following setting in your config/initializers/para.rb
:
config.acl. = true
Contributing
- Fork it ( https://github.com/para-cms/para-acl/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request