Authoreyes (pronounced "authorize") is intended to be a modern, Rails 5 compatible replacement for Declarative Authorization.
This is a FreeAgent fork of authoreyes to maintain rails compatibility as upstream has stopped.
This Gem is owned and managed by the Core Services team. Released to github packages.
Packaging is handled by Jenkins, to push a new release:
- Create a PR that increases the version in
version.rb
- Get that reviewed and approved.
- Merge, on successful build Jenkins will package the gem and release it to github packages.
- Update the bundles for any applications using this gem.
You can track builds in slack, #authoreyes-ci. Track releases in #gem-release.
See Internal Gems for more detail.
Add this line to your application's Gemfile:
gem 'authoreyes'
And then execute:
$ bundle
Or install it yourself as:
$ gem install authoreyes
For Rails authorization in Rails versions 4 and below, please use Declarative Authorization or one of its forks.
Warning! This gem is not finished!
At this point, to use Authoreyes, you must do the following:
- Add an
authorization_rules.rb
file. See the included one for an example. The syntax is the same as Declarative Authorization, so you can look at their examples too. - Define privileges for every single action you want to be accessed. As of now, Authoreyes has only one mode: authorize everything.
- Done! Authoreyes will do its job.
If you want to customize authorization behavior, in your ApplicationController override Authoreyes's redirect_if_unauthorized
before_action and set_unauthorized_status_code
after_action. See lib/authoreyes/helpers/in_controller
for details.
Bug reports and pull requests are welcome on GitHub at https://github.com/tektite-software/authoreyes.
Please check out the wiki for guides on contributing to this project.
This gem was originally based on stffn's gem Declarative_Authorization. Many thanks to stffn and all who contributed to Declarative Authorization for a great gem!
The gem is available as open source under the terms of the MIT License.
©️ 2016 Tektite Software