Class: Decidim::Blog::Permissions

Inherits:
DefaultPermissions show all
Defined in:
decidim-blogs/app/permissions/decidim/blog/permissions.rb

Instance Method Summary collapse

Methods inherited from DefaultPermissions

#initialize

Constructor Details

This class inherits a constructor from Decidim::DefaultPermissions

Instance Method Details

#permissionsObject


6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'decidim-blogs/app/permissions/decidim/blog/permissions.rb', line 6

def permissions
  return permission_action unless permission_action.subject == :blogpost

  if permission_action.scope == :public
    allow!
    return permission_action
  end

  return permission_action if permission_action.scope != :admin

  allow!
  permission_action
end