Sha256: 99b3c7381425985eb193ad9610c34467c0f3788e2d9d8ab7ee3f8ce3df20c95c

Contents?: true

Size: 280 Bytes

Versions: 3

Compression:

Stored size: 280 Bytes

Contents

module NippoCore
  class GroupPolicy < ApplicationPolicy
    attr_reader :user, :group

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

    def edit?
      @group.member?(user)
    end

    def update?
      @group.member?(user)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nippo_core-1.0.2 app/policies/nippo_core/group_policy.rb
nippo_core-1.0.1 app/policies/nippo_core/group_policy.rb
nippo_core-1.0.0 app/policies/nippo_core/group_policy.rb