Sha256: 101ba334debeb5d3153b7a60df9ba00dc3f04904442f4938f91a0de967a9f4cb

Contents?: true

Size: 527 Bytes

Versions: 10

Compression:

Stored size: 527 Bytes

Contents

class UserPolicy
  attr_reader :current_user, :user

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

  def manage?
    action = Storytime::Action.find_by(guid: "1f7d47")
    @current_user.storytime_role.present? && @current_user.storytime_role.allowed_actions.include?(action)
  end

  def index?
    manage?
  end

  def edit?
    manage?
  end

  def update?
    manage?
  end

  def new?
    manage?
  end

  def create?
    manage?
  end

  def destroy?
    manage?
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
storytime-1.2.0 app/policies/user_policy.rb
storytime-1.1.1 app/policies/user_policy.rb
storytime-1.0.7 app/policies/user_policy.rb
storytime-1.0.6 app/policies/user_policy.rb
storytime-1.0.5 app/policies/user_policy.rb
storytime-1.0.2 app/policies/user_policy.rb
storytime-1.0.1 app/policies/user_policy.rb
storytime-1.0.0 app/policies/user_policy.rb
storytime-0.0.4 app/policies/user_policy.rb
storytime-0.0.2 app/policies/user_policy.rb