Class: GroupPolicy

Inherits:
Namespaces::GroupProjectNamespaceSharedPolicy show all
Includes:
FindGroupProjects
Defined in:
app/policies/group_policy.rb

Instance Method Summary collapse

Methods included from FindGroupProjects

#group_projects_for

Instance Method Details

#access_level(for_any_session: false) ⇒ Object


282
283
284
285
286
287
# File 'app/policies/group_policy.rb', line 282

def access_level(for_any_session: false)
  return GroupMember::NO_ACCESS if @user.nil?
  return GroupMember::NO_ACCESS unless user_is_user?

  @access_level ||= lookup_access_level!(for_any_session: for_any_session)
end

#lookup_access_level!(for_any_session: false) ⇒ Object


289
290
291
# File 'app/policies/group_policy.rb', line 289

def lookup_access_level!(for_any_session: false)
  @subject.max_member_access_for_user(@user)
end