Sha256: 67400645f58fce6e09b0d60b561818fc1650f2dee14ac82880271faef6598300

Contents?: true

Size: 573 Bytes

Versions: 6

Compression:

Stored size: 573 Bytes

Contents

# frozen_string_literal: true

class UserPolicy < Policy
  def index?
    true
  end

  def deactivated?
    index?
  end

  def new?
    User.none? || user.role?(:users)
  end

  def create?
    new?
  end

  def login?
    true
  end

  def manage?
    new?
  end

  def edit?
    user == record || user.role?(:users)
  end

  def show?
    edit?
  end

  def delete_image?
    edit?
  end

  def policies?
    user.role?(:users)
  end

  def destroy?
    user.role?(:users)
  end

  def change_password?
    user == record
  end

  def otp?
    user == record
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pages_core-3.15.5 app/policies/user_policy.rb
pages_core-3.15.4 app/policies/user_policy.rb
pages_core-3.15.3 app/policies/user_policy.rb
pages_core-3.15.2 app/policies/user_policy.rb
pages_core-3.15.1 app/policies/user_policy.rb
pages_core-3.14.0 app/policies/user_policy.rb