Class: Ability

Inherits:
Object
  • Object
show all
Includes:
Hydra::Ability
Defined in:
lib/generators/hydra/templates/ability.rb

Instance Method Summary collapse

Instance Method Details

#custom_permissionsObject

Define any customized permissions here.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/hydra/templates/ability.rb', line 5

def custom_permissions
  # Limits deleting objects to a the admin user
  #
  # if current_user.admin?
  #   can [:destroy], ActiveFedora::Base
  # end

  # Limits creating new objects to a specific group
  #
  # if user_groups.include? 'special_group'
  #   can [:create], ActiveFedora::Base
  # end
end