Module: AccessRoles::Roles

Includes:
RoleTypes
Defined in:
lib/access_roles/roles.rb

Constant Summary collapse

RESOURCE_SCOPE =
"resource".freeze
POLICY_SCOPE =
"policy".freeze
SCOPES =
[RESOURCE_SCOPE, POLICY_SCOPE].freeze

Constants included from RoleTypes

AccessRoles::RoleTypes::CONTRIBUTOR, AccessRoles::RoleTypes::CURATOR, AccessRoles::RoleTypes::DOWNLOADER, AccessRoles::RoleTypes::EDITOR, AccessRoles::RoleTypes::METADATA_EDITOR, AccessRoles::RoleTypes::VIEWER

Class Method Summary collapse

Class Method Details

.role_typesObject


15
16
17
# File 'lib/access_roles/roles.rb', line 15

def role_types
  @role_types ||= RoleTypes.constants(false).map { |const| RoleTypes.const_get(const) }
end

.type_mapObject


11
12
13
# File 'lib/access_roles/roles.rb', line 11

def type_map
  @type_map ||= role_types.map { |role_type| [role_type.to_s, role_type] }.to_h
end