Module: Ddr::Auth::Roles
- Extended by:
- ActiveSupport::Autoload, Deprecation
- Includes:
- RoleTypes
- Defined in:
- lib/ddr/auth/roles.rb,
lib/ddr/auth/roles/role.rb,
lib/ddr/auth/roles/role_set.rb,
lib/ddr/auth/roles/role_type.rb,
lib/ddr/auth/roles/role_types.rb,
lib/ddr/auth/roles/role_set_query.rb,
lib/ddr/auth/roles/detached_role_set.rb,
lib/ddr/auth/roles/property_role_set.rb
Defined Under Namespace
Modules: RoleTypes
Classes: DetachedRoleSet, PropertyRoleSet, Role, RoleSet, RoleSetQuery, RoleType
Constant Summary
collapse
- RESOURCE_SCOPE =
"resource".freeze
- POLICY_SCOPE =
"policy".freeze
- SCOPES =
[RESOURCE_SCOPE, POLICY_SCOPE].freeze
Constants included
from RoleTypes
RoleTypes::CONTRIBUTOR, RoleTypes::CURATOR, RoleTypes::DOWNLOADER, RoleTypes::EDITOR, RoleTypes::METADATA_EDITOR, RoleTypes::VIEWER
Class Method Summary
collapse
Class Method Details
.const_missing(name) ⇒ Object
22
23
24
25
26
27
28
29
30
|
# File 'lib/ddr/auth/roles.rb', line 22
def const_missing(name)
if name == :ArrayRoleSet
Deprecation.warn(Ddr::Auth::Roles, "`Ddr::Auth::Roles::ArrayRoleSet` is deprecated." \
" Use `Ddr::Auth::Roles::DetachedRoleSet` instead.")
DetachedRoleSet
else
super
end
end
|
.role_types ⇒ Object
36
37
38
|
# File 'lib/ddr/auth/roles.rb', line 36
def role_types
@role_types ||= RoleTypes.constants(false).map { |const| RoleTypes.const_get(const) }
end
|
.type_map ⇒ Object
32
33
34
|
# File 'lib/ddr/auth/roles.rb', line 32
def type_map
@type_map ||= role_types.map { |role_type| [role_type.to_s, role_type] }.to_h
end
|