Sha256: 4f804de2b697b850eec733efa217f64aaca0e08a30f07e4362686b60673fc2d3

Contents?: true

Size: 725 Bytes

Versions: 1

Compression:

Stored size: 725 Bytes

Contents

module Georgia
  class UserPolicy < ApplicationPolicy

    def index?
      users_user_permissions(:show_users).include?(true)
    end

    def show?
      edit?
    end

    def new?
      create?
    end

    def create?
      users_user_permissions(:create_users).include?(true)
    end

    def edit?
      update?
    end

    def update?
      users_user_permissions(:update_users).include?(true)
    end

    def destroy?
      users_user_permissions(:delete_users).include?(true)
    end

    def permissions?
      true
    end

    private

    def users_permissions
      Georgia.permissions[:users]
    end

    def users_user_permissions action
      user_permissions(users_permissions, action)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
georgia-0.8.0 app/policies/georgia/user_policy.rb