<commit_before>= Authorization-San

Authorization-san allows you to specify access policies in your controllers. The plugin assumes a number of things about the application.

* If a user has authenticated with the application, it's stored in <tt>@authenticated</tt>. The method of authentication doesn't matter.
* <tt>@authenticated</tt> has either a <tt>role</tt> attribute or a number of methods to query for the role: <tt>admin?</tt>, <tt>editor?</tt>, <tt>guest?</tt>. When the <tt>@authenticated</tt> object doesn't have role methods it's 

== What does it look like?

  class BooksController < ActionController::Base
    # Visitors can see list of books and book pages
    allow_access :all, :only => [:index, :show]
    # An editor can create new books, but…
    allow_access :editor, :only => [:new, :create]
    # …she can only update her own books.
    allow_access(:editor, :only => [:edit, :update]) { @book = @authenticated.books.find(params[:id]) }<commit_msg>Update the README because it ended in a half sentence for some reason.<commit_after>= Authorization-San

Authorization-san allows you to specify access policies in your controllers. The plugin assumes a number of things about the application.

* If a user has authenticated with the application, it's stored in <tt>@authenticated</tt>. The method of authentication doesn't matter. It also doesn't matter what you put in @authenticated, as long as it's truthy.
* <tt>@authenticated</tt> has either a <tt>role</tt> attribute or a number of methods to query for the role: <tt>admin?</tt>, <tt>editor?</tt>, <tt>guest?</tt>. When the <tt>@authenticated</tt> object doesn't have role methods you can't use role based authentication rules, but the rest still works.

== What does it look like?

  class BooksController < ActionController::Base
    # Visitors can see list of books and book pages
    allow_access :all, :only => [:index, :show]
    # An editor can create new books, but…
    allow_access :editor, :only => [:new, :create]
    # …she can only update her own books.
    allow_access(:editor, :only => [:edit, :update]) { @book = @authenticated.books.find(params[:id]) }
{'fraction_non_alphanumeric': 0.11436541143654114, 'fraction_numerical': 0.0, 'mean_word_length': 4.517948717948718, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2672448', 'n_tokens_mistral': 620, 'n_tokens_neox': 602, 'n_words': 267}