Last active
January 19, 2016 23:01
-
-
Save justinlyman/f76ec6116a9660d50a2d to your computer and use it in GitHub Desktop.
Locking Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commission_report.rb | |
def locked? | |
// if reviewed by manager and marker | |
// return true | |
// else | |
// return false | |
// end | |
end | |
abilty.rb | |
def initialize(user) | |
if user.has_role? :marketer | |
can :edit, :update, CommissionReport do |report| | |
!report.locked? | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment