Class: Decidim::Budgets::Admin::Permissions

Inherits:
DefaultPermissions
  • Object
show all
Defined in:
app/permissions/decidim/budgets/admin/permissions.rb

Instance Method Summary collapse

Instance Method Details

#permissionsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/permissions/decidim/budgets/admin/permissions.rb', line 7

def permissions
  # The public part needs to be implemented yet
  return permission_action if permission_action.scope != :admin

  return permission_action if permission_action.subject != :project

  case permission_action.action
  when :create
    permission_action.allow!
  when :update, :destroy
    permission_action.allow! if project.present?
  end

  permission_action
end