Module: UU::OS::Permission
- Extended by:
- Permission
- Included in:
- Permission
- Defined in:
- uu_os-0.29.16/lib/uu/os/permission.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_grant.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_level.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_revoke.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_authorize.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_get_mask_list.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_authorize_result.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_get_authority_list.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_get_authority_data.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_get_mask_attributes.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_get_system_group_list.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_get_authority_list_item.rb,
uu_os-0.29.16/lib/uu/os/permission/permission_get_system_group_attributes.rb
Overview
Module Permission.
Defined Under Namespace
Classes: PermissionAuthorize, PermissionAuthorizeResult, PermissionGetAuthorityData, PermissionGetAuthorityList, PermissionGetAuthorityListItem, PermissionGetMaskAttributes, PermissionGetMaskList, PermissionGetSystemGroupAttributes, PermissionGetSystemGroupList, PermissionGrant, PermissionLevel, PermissionRevoke
Constant Summary
- PATH =
REST service url path.
'ues/core/security/UESPermission'
Instance Method Summary (collapse)
-
- (UU::OS::Permission::PermissionAuthorizeResult) authorize(entity_uri, options)
Checks whether the logged user is authorized to the specific use case over the specific entity.
-
- (UU::OS::REST::BinaryValue) get_authority_data(entity_uri, options)
Returns data about permissions granted to the given authority (Role, Group or System Group) on object (only Artifacts in current version).
-
- (Array) get_authority_list(entity_uri, criteria = nil)
Returns a list of authorities (Roles, Groups or System Groups) who have been granted permissions on a object (only Artifacts in current version).
-
- (Array) get_mask_list(artifact_uri, criteria = nil)
Returns a list of permission masks for an Artifact.
-
- (Array) get_system_group_list(entity_uri, criteria = nil)
Returns a list of System Groups of an entity (object or pack).
-
- (Object) grant(entity_uri, permission)
Grants permissions on objects (only Artifacts in current version) according to given Permission Mask or according to detailed permission specification (defined access level for chosen use cases).
-
- (Object) revoke(entity_uri, permission)
Revokes permissions on an object (only Artifact in current version) for given Use Cases.
Instance Method Details
- (UU::OS::Permission::PermissionAuthorizeResult) authorize(entity_uri, options)
Checks whether the logged user is authorized to the specific use case over the specific entity. If the user is not authorized to run the specified use case, the authorization exception (UU::OS::Security::AuthorizationException: E05401.M08) is thrown.
Note that authorization entities may differ from main entities of specific uuCommands. For example the uuCommand UU::OS::Property.create uses an artifact as the main entity, but it is authorized over the property group where the property is to be created.
222 223 224 225 226 227 228 229 230 231 232 |
# File 'uu_os-0.29.16/lib/uu/os/permission.rb', line 222 def (entity_uri, ) svc = UU::OS::REST::RemoteClient.new(Permission) dto = Permission::PermissionAuthorize.new() svc.add_parameter('useCaseCode', dto.use_case_code) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('authorize', entity_uri) return Permission::PermissionAuthorizeResult.new(res) end end |
- (UU::OS::REST::BinaryValue) get_authority_data(entity_uri, options)
Returns data about permissions granted to the given authority (Role, Group
or System Group) on object (only Artifacts in current version).
To
list all authorities with granted permissions use uuCommand
#get_authority_list.
151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'uu_os-0.29.16/lib/uu/os/permission.rb', line 151 def (entity_uri, ) svc = UU::OS::REST::RemoteClient.new(Permission) dto = UU::OS::Permission::PermissionGetAuthorityData.new() svc.add_parameter('authorityUri', dto.) if dto.requested_mime_type svc.add_parameter('requestedMimeType', dto.requested_mime_type) end UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAuthorityData', entity_uri) return UU::OS::REST::BinaryValue.new(res, true) end end |
- (Array) get_authority_list(entity_uri, criteria = nil)
Returns a list of authorities (Roles, Groups or System Groups) who have been granted permissions on a object (only Artifacts in current version).
120 121 122 123 124 125 126 127 128 129 130 |
# File 'uu_os-0.29.16/lib/uu/os/permission.rb', line 120 def (entity_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Permission) dto = Permission::PermissionGetAuthorityList.new(criteria) svc.add_parameter('pageIndex', dto.page_index) svc.add_parameter('pageSize', dto.page_size) svc.add_parameter('query', dto.query) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAuthorityList', entity_uri) return UU::OS::REST::ResultList.new(Permission::PermissionGetAuthorityList, Permission::PermissionGetAuthorityListItem, res) end end |
- (Array) get_mask_list(artifact_uri, criteria = nil)
Returns a list of permission masks for an Artifact.
176 177 178 179 180 181 182 183 184 185 186 |
# File 'uu_os-0.29.16/lib/uu/os/permission.rb', line 176 def get_mask_list(artifact_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Permission) dto = Permission::PermissionGetMaskList.new(criteria) svc.add_parameter('pageIndex', dto.page_index) svc.add_parameter('pageSize', dto.page_size) svc.add_parameter('query', dto.query) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getMaskList', artifact_uri) return UU::OS::REST::ResultList.new(Permission::PermissionGetMaskList, Permission::PermissionGetMaskAttributes, res) end end |
- (Array) get_system_group_list(entity_uri, criteria = nil)
Returns a list of System Groups of an entity (object or pack). It may be used to set permissions for these groups.
197 198 199 200 201 202 203 204 205 |
# File 'uu_os-0.29.16/lib/uu/os/permission.rb', line 197 def get_system_group_list(entity_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Permission) dto = Permission::PermissionGetSystemGroupList.new(criteria) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getSystemGroupList', entity_uri) return UU::OS::REST::ResultList.new(Permission::PermissionGetSystemGroupList, Permission::PermissionGetSystemGroupAttributes, res) end end |
- (Object) grant(entity_uri, permission)
Grants permissions on objects (only Artifacts in current version) according
to given Permission Mask or according to detailed permission specification
(defined access level for chosen use cases). It is possible to grant
permission on objects for any allowed authority (Role, Group or System
Group).
To list all allowed system groups use uuCommand
#get_system_group_list.
All possible levels may be found as
constants in PermissionLevel class.
53 54 55 56 57 58 59 60 |
# File 'uu_os-0.29.16/lib/uu/os/permission.rb', line 53 def grant(entity_uri, ) svc = UU::OS::REST::RemoteClient.new(Permission) payload = UU::OS::Permission::PermissionGrant.new().to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('grant', entity_uri, payload) end end |
- (Object) revoke(entity_uri, permission)
Revokes permissions on an object (only Artifact in current version) for
given Use Cases. It is possible to revoke permissions on objects for any
allowed authority (Role, Group or System Group).
To list all allowed
system groups use uuCommand #get_system_group_list.
83 84 85 86 87 88 89 90 |
# File 'uu_os-0.29.16/lib/uu/os/permission.rb', line 83 def revoke(entity_uri, ) svc = UU::OS::REST::RemoteClient.new(Permission) payload = UU::OS::Permission::PermissionRevoke.new().to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('revoke', entity_uri, payload) end end |