rajeevkannav/zero_authorization — pull request #1 by praveenkumarsinha (2014-02-04 15:27:57+00:00)
Title: Updating feature of runtime evaluation of rule-set to access privileges

Hi Rajeev,

Have added feature to do runtime evaluation of privileges so that yml can accommodate an extra key ':if' whose value is a method name which needs to be defined by developer in model so that it can return true/false to apply the rule-set for access rights.

New yml needs to be in format

:role_role_name_one:
:can_do:
:Account:
- :create
- :save
- :update
:User:
- :create
- :save
- :update
:ModelCrudHistory: :anything
:Permission: :anything
:cant_do:
:Project:
- :destroy
:role_role_name_two:
:can_do:
:Project:
- :create
- :save:
:if:
:authorize?
- :update:
:if:
:authorize?
- :destroy:
:if:
:authorize?