Class: Decidim::Accountability::Permissions

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

Instance Method Summary collapse

Instance Method Details

#permissionsObject



6
7
8
9
10
11
12
13
# File 'app/permissions/decidim/accountability/permissions.rb', line 6

def permissions
  return permission_action unless user

  # Delegate the admin permission checks to the admin permissions class
  return Decidim::Accountability::Admin::Permissions.new(user, permission_action, context).permissions if permission_action.scope == :admin

  permission_action
end