Skip to content

Commit

Permalink
reverted one line of permissions to deal with blank perms
Browse files Browse the repository at this point in the history
  • Loading branch information
ethn committed Oct 26, 2010
1 parent 11810c6 commit 289a612
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/cardlib/permissions.rb
Expand Up @@ -109,9 +109,7 @@ def permit(task, party) #assign permissions
end

def who_can(operation)
#perm = permissions.reject { |perm| perm.task != operation.to_s }.first
#perm && perm.party ? perm.party : nil
perm = Permission.find(:first, :conditions=>{:card_id=>self.id, :task=>operation.to_s })
perm = permissions.reject { |perm| perm.task != operation.to_s }.first
perm && Role[perm.party_id.to_i]
end

Expand Down

0 comments on commit 289a612

Please sign in to comment.