README.md in arpa-0.0.5 vs README.md in arpa-0.0.6

- old
+ new

@@ -39,11 +39,11 @@ **Obs.:** The migration file will create a associate table between **Profiles** and **Users** (the Users must exist in your Application before adding the Gem) ## Usage -First of all you must create the Resources, Roles and Profiles (each is avaliable in the paths listed above). After that you need associate **Profiles** with **User** (to do this, you need create by your own the associate form view, saving some profiles in some user). Done that you can use some Helpers generated by Arpa. +First of all you must create the Resources, Roles and Profiles (each is avaliable in the paths listed in a section bellow). After that you need associate **Profiles** with **User** (to do this, you need create by your own the associate form view, saving some profiles in some user). Done that you can use some Helpers generated by Arpa. ### Association between Profiles and Users You just need have a method called **:profile_ids** inside the User model. This method should return a list of ids from profiles associated in the user. @@ -63,19 +63,27 @@ To verify if a user has access to some :controler and :action, use the following helper: ```ruby has_access?('users', 'index') ``` + +To reset the session permissions created by Arpa, use the following helper: + +```ruby +reset_permissions +``` + **Obs.:** To that helper method works. You must have **:session** (In Rails app already has) and **:current_user** attribute or method. --- -If you want use that method inside another object you should use the **Arpa::Services::Verifier** class; +If you want use that methods inside another object you should use the **Arpa::Services::Verifier** class; You just need pass as arguments the :session and :current_user: ```ruby verifier = Arpa::Services::Verifier.new(session, current_user) verifier.has_access?('users', 'index') +verifier.reset_permissions ``` ### Controller Filter If you want create a filter to verify if the current_user has access and if not redirect to another route you can do this: