Skip to content

Instantly share code, notes, and snippets.

@abacha
Created February 15, 2013 17:25
Show Gist options
  • Select an option

  • Save abacha/4961895 to your computer and use it in GitHub Desktop.

Select an option

Save abacha/4961895 to your computer and use it in GitHub Desktop.
def comercial(user)
can [:manage], Account, :officer_id => user.id
can [:manage], Account, :co_officer_id => user.id
can :read, [Balance, HistoricBalance], :account => { :officer_id => user.id }
can :read, [Balance, HistoricBalance], :account => { :co_officer_id => user.id }
can [:manage], Person, :accounts => { :officer_id => user.id }
can [:manage], Person, :accounts => { :co_officer_id => user.id }
can [:read], Documentation do |documentation|
can?(:read, documentation.account)
end
can [:read, :activity], [Fund, Manager]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment