Class: RiotCarrierwave::HasPermissionAssertion
- Inherits:
-
Riot::AssertionMacro
- Object
- Riot::AssertionMacro
- RiotCarrierwave::HasPermissionAssertion
- Defined in:
- lib/riot-carrierwave/has_permission.rb
Instance Method Summary collapse
Instance Method Details
#evaluate(model, permission) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/riot-carrierwave/has_permission.rb', line 5 def evaluate(model, ) if model and ((File.stat(model.path).mode & 0777) == ) pass("#{model.class.name} has permission of #{.to_s(8)}") else fail("expected #{model.class.name} to have permission of #{.to_s(8)}") end end |