Sha256: 9d4cc64b954652baf343ba9e0f529f145805925ed8ad1e12fa763887a71b48fd

Contents?: true

Size: 432 Bytes

Versions: 11

Compression:

Stored size: 432 Bytes

Contents

# frozen_string_literal: true

require_relative 'application_policy'

module ProxES
  class IdentityPolicy < ApplicationPolicy
    def register?
      true
    end

    def permitted_attributes
      [:username, :password, :password_confirmation]
    end

    class Scope < ApplicationPolicy::Scope
      def resolve
        if user.super_admin?
          scope.all
        else
          []
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
proxes-0.7.1 lib/proxes/policies/identity_policy.rb
proxes-0.7.0 lib/proxes/policies/identity_policy.rb
proxes-0.6.1 lib/proxes/policies/identity_policy.rb
proxes-0.6.0 lib/proxes/policies/identity_policy.rb
proxes-0.5.2 lib/proxes/policies/identity_policy.rb
proxes-0.5.1 lib/proxes/policies/identity_policy.rb
proxes-0.5.0 lib/proxes/policies/identity_policy.rb
proxes-0.4.4 lib/proxes/policies/identity_policy.rb
proxes-0.4.3 lib/proxes/policies/identity_policy.rb
proxes-0.4.2 lib/proxes/policies/identity_policy.rb
proxes-0.4.1 lib/proxes/policies/identity_policy.rb