Sublime's custom image

Monarchy is a ruby gem offering a complete solution to manage an access in your web application. Hierarchical structure and built-in roles inheritance options make it the most powerful tool to control an access to your resources. Thanks to [closure_tree](https://github.com/mceachen/closure_tree), Monarchy can deliver the best in class algorithmic performance and allows you to forget about hierarchies and complicated structures. It is like a [rolify](https://github.com/RolifyCommunity/rolify) but with advanced possibilities to inherit roles and collect all accessible resources with just one method. ## Usage Example After Monarchy setup you can enjoy with roles inheritance and accessible resources. ```ruby # Create roles admin_role = Monarchy.role_class.create(name: :admin, level: 5, inherited: true) manager_role = Monarchy.role_class.create(name: :manager, level: 4, inherited_role: admin_role, inherited: true) # Create resources project1 = Project.create() project2 = Project.create(parent: project1) project3 = Project.create(parent: project2) project4 = Project.create() # Grant user user.grant(:manager, project2) # Accessible projects Project.accessible_for(user) # returns [Project1, Project2, Project3] # User inherited roles user.roles_for(project1) # returns a default role eg. [guest_role] user.roles_for(project2) # returns [manager_role] user.roles_for(project3) # returns [admin_role] user.roles_for(project4) # returns empty array [] ``` ## Requirements Monarchy requires: - Ruby 2.3 ## Documentation We are preparing an official [website][5c7e0096] with documentation. Meanwhile you can look to the `docs` directory for actual [documentation](https://github.com/Exelord/Monarchy/tree/master/docs). ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/exelord/Monarchy. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct. ## License This version of the gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). [5c7e0096]: https://exelord.github.io/Monarchy/ "Monarchy Website"