app/models/contextual_permission.rb
def fetch(user, entity)
      return nil if user.blank? || user.anonymous?
      return nil unless entity.kind_of?(HierarchicalEntity)

      for_user(user).for_hierarchical(entity).first || empty_permission_for(user, entity)
    end
# If a match cannot be found for the provided combination,
# {#empty_permission_for an empty result} will be provided.
#
# @param [User] user
# @param [HierarchicalEntity] entity
# @return [ContextualPermission]
If a match cannot be found for the provided combination,
{#empty_permission_for an empty result} will be provided.
If a match cannot be found for the provided combination { #empty_permission_for an empty result } will be provided .
def fetch(user, entity)
      return nil if user.blank? || user.anonymous?
      return nil unless entity.kind_of?(HierarchicalEntity)
      for_user(user).for_hierarchical(entity).first || empty_permission_for(user, entity)
    end
def fetch ( user , entity ) return nil if user . blank? || user . anonymous? return nil unless entity . kind_of? ( HierarchicalEntity ) for_user ( user ) . for_hierarchical ( entity ) . first || empty_permission_for ( user , entity ) end
If a match cannot be found for the provided combination,
{#empty_permission_for an empty result} will be provided.
If a match cannot be found for the provided combination { #empty_permission_for an empty result } will be provided .
None
ContextualPermission
user
entity
None