Sha256: 0005d391769954af2abcb07cc13ccb799861dde79b27cdff5ac2b14f065a48c1

Contents?: true

Size: 517 Bytes

Versions: 6

Compression:

Stored size: 517 Bytes

Contents

# frozen_string_literal: true

# Policy for Role model
class RolePolicy < ControllerPolicy
  attr_reader :user, :objects

  def initialize(user, objects)
    @user = user
    @objects = objects
  end

  def clone?
    false
  end

  def add_permissions?
    keppler_admin? || user_can?(@objects, 'add_permissions')
  end

  def create_permissions?
    keppler_admin? || user_can?(@objects, 'create_permissions')
  end

  def show_description?
    keppler_admin? || user_can?(@objects, 'create_permissions')
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
keppler-2.0.7 installer/core/app/policies/role_policy.rb
keppler-2.0.6 installer/core/app/policies/role_policy.rb
keppler-2.0.5 installer/core/app/policies/role_policy.rb
keppler-2.0.4.p1 installer/core/app/policies/role_policy.rb
keppler-2.0.4.pre.p1 installer/core/app/policies/role_policy.rb
keppler-2.0.4 installer/core/app/policies/role_policy.rb