Class: VideoAbility
- Inherits:
-
Object
- Object
- VideoAbility
- Includes:
- CanCan::Ability
- Defined in:
- lib/forge/app/abilities/video_ability.rb
Instance Method Summary collapse
-
#initialize(u) ⇒ VideoAbility
constructor
A new instance of VideoAbility.
Constructor Details
#initialize(u) ⇒ VideoAbility
Returns a new instance of VideoAbility.
3 4 5 6 7 8 9 10 |
# File 'lib/forge/app/abilities/video_ability.rb', line 3 def initialize(u) if u.is_contributor? can([:create, :play], Video) can([:update, :destroy, :edit], Video) do |item| u.id == item.creator_id end end end |