Api Authorization (The gem is in development)
A multiple role-based authorization, based on controller actions.
Database Model
Installation
Add this line to your application's Gemfile:
gem 'api_authorization'
And then execute:
$ bundle
Or install it yourself as:
$ gem install api_authorization
Usage
- After you have created your users_table(through devise or manually) next run
bash $ rails api_auth:install
- Next populate permissions table with your controllers and actions run:
bash $ rails api_auth:re_populate_permissions
- Include the Authorization module on your
ApplicationController
:ruby include ActionController::Helpers include ApiAuthorization enable_role_authorization
- You can create/read/update/delete roles and permissions for the user through CLI commands or by
using the dashboard which you need to install seperately by running:
bash rails api_auth:install_dashboard
- And after running the rails app visit:
http://localhost:3000/auth_dashboard
# ### CLI commands
Managing Roles and Permissions
There are two ways to manage your roles and
Contributing
Feel free to suggest a feature or report a bug.
Code Of Conduct
License
The gem is available as open source under the terms of the MIT License.