Module: UU::OS::Cast
- Extended by:
- Cast
- Included in:
- Cast
- Defined in:
- uu_os-0.29.16/lib/uu/os/cast.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_state.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_level.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_create.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_delete.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_exists.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_direction.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_attributes.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_subject_type.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_get_cast_list.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_get_attributes.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_history_attributes.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_verify_cast_existence.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_get_cast_history_list.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_access_role_attributes.rb,
uu_os-0.29.16/lib/uu/os/cast/cast_get_access_role_cast_list.rb
Overview
Module Cast.
Defined Under Namespace
Classes: CastAccessRoleAttributes, CastAttributes, CastCreate, CastDelete, CastDirection, CastExists, CastGetAccessRoleCastList, CastGetAttributes, CastGetCastHistoryList, CastGetCastList, CastHistoryAttributes, CastLevel, CastSetAttributes, CastState, CastSubjectType, CastVerifyCastExistence
Constant Summary
- PATH =
Service path
'ues/core/role/UESCast'
Instance Method Summary (collapse)
-
- (Object) create(subject_uri, cast = nil)
Casts a subject (role or group) to another subject (role or group).
-
- (Object) delete(subject_uri, cast = nil)
Deletes the cast from the system.
-
- (Boolean) exists(subject_uri, cast = nil)
Checks the cast existence of a subject (access role, role or group) to another subject (role or group) specified in subject_uri.
-
- (Array) get_access_role_cast_list(subject_uri, criteria = nil)
Returns list of access roles (personal access roles and uuEEs) casted directly or indirectly to the specified subject (role or group).
-
- (CastAttributes) get_attributes(subject_uri, dto)
Returns attributes of one cast.
-
- (Array) get_cast_history_list(subject_uri, criteria = nil)
Returns a cast history list in the subject and/or from the subject.
-
- (Array) get_cast_list(subject_uri, criteria = nil)
Returns list of casts to the specified subject (role or group).
-
- (Object) set_attributes(subject_uri, cast = nil)
Sets basic attributes of the cast.
-
- (UU::OS::UESURI[]) verify_cast_existence(territoryUri, criteria = nil)
Verifies the cast existence of a user to a list of subjects in a given territory.
Instance Method Details
- (Object) create(subject_uri, cast = nil)
Casts a subject (role or group) to another subject (role or group). Only roles and groups from the same territory are supported at the moment (therefore it is not possible to cast across territories and form pseudo business access role relation at the moment). Cast is not an entity, it is a relation between two subjects (and these two subjects identify the relation). Note that only some combinations of subjects in a cast relation are permitted.
59 60 61 62 63 64 65 66 |
# File 'uu_os-0.29.16/lib/uu/os/cast.rb', line 59 def create(subject_uri, cast = nil) svc = UU::OS::REST::RemoteClient.new(Cast) payload = UU::OS::Cast::CastCreate.new(cast).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('create', subject_uri, payload) end end |
- (Object) delete(subject_uri, cast = nil)
Deletes the cast from the system. Any change of user authorization resulting from the cast modification will take effect approximately after 15 minutes. The last active executive cast cannot be deleted when this role has an active assistance or guest cast (active casts of these types cannot exist without at least one active executive cast). The last active executive cast for this role cannot be deleted when the role is competent for at least one artifact (a role without an active cast cannot be competent for any artifacts).
196 197 198 199 200 201 202 203 |
# File 'uu_os-0.29.16/lib/uu/os/cast.rb', line 196 def delete(subject_uri, cast = nil) svc = UU::OS::REST::RemoteClient.new(Cast) payload = UU::OS::Cast::CastDelete.new(cast).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('delete', subject_uri, payload) end end |
- (Boolean) exists(subject_uri, cast = nil)
Checks the cast existence of a subject (access role, role or group) to another subject (role or group) specified in subject_uri. The cast subject is identified either by UESURI or by Universe ID of a user whose access role is cast to subjectUri. Only the existence of a direct cast is checked by default. The existence of an indirect cast can be checked only between an access role (identified either by UESURI or by Universe ID) and another subject (role or group).
231 232 233 234 235 236 237 238 239 240 241 |
# File 'uu_os-0.29.16/lib/uu/os/cast.rb', line 231 def exists(subject_uri, cast = nil) svc = UU::OS::REST::RemoteClient.new(Cast) dto = UU::OS::Cast::CastExists.new(cast) svc.add_parameter('castedSubjectUri', dto.casted_subject_uri) svc.add_parameter('castedSubjectUniverseId', dto.casted_subject_universe_id) svc.add_parameter('recursive', dto.recursive) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('exists', subject_uri) return (res == 'true') || (res == '"true"') end end |
- (Array) get_access_role_cast_list(subject_uri, criteria = nil)
Returns list of access roles (personal access roles and uuEEs) casted directly or indirectly to the specified subject (role or group). The list is sorted by the casted subject name and subsequently by casted subject code by default.
135 136 137 138 139 140 141 142 143 144 145 |
# File 'uu_os-0.29.16/lib/uu/os/cast.rb', line 135 def get_access_role_cast_list(subject_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Cast) dto = Cast::CastGetAccessRoleCastList.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('getAccessRoleCastList', subject_uri) return UU::OS::REST::ResultList.new(Cast::CastGetAccessRoleCastList, Cast::CastAccessRoleAttributes, res) end end |
- (CastAttributes) get_attributes(subject_uri, dto)
Returns attributes of one cast. Cast is identified by two subjects. The main entity (a subject to which the other is casted) and parameter casted_subject_uri in the DTO (the casted subject).
83 84 85 86 87 88 89 90 91 |
# File 'uu_os-0.29.16/lib/uu/os/cast.rb', line 83 def get_attributes(subject_uri, dto) svc = UU::OS::REST::RemoteClient.new(Cast) get_dto = UU::OS::Cast::CastGetAttributes.new(dto) svc.add_parameter('castedSubjectUri', get_dto.casted_subject_uri) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('getAttributes', subject_uri) return Cast::CastAttributes.new(res) end end |
- (Array) get_cast_history_list(subject_uri, criteria = nil)
Returns a cast history list in the subject and/or from the subject. Only direct casts are supported. Casts are filtered and ordered by the query criteria. By default, only casts IN the subject are returned, sorted by the castCreationStamp. Result list cannot be paged. The maximum number of casts returned is 10,000. In case of exceeding the limit, an exception is thrown. Cast strategy 1 or higher must be enabled for the territory to use this command.
295 296 297 298 299 300 301 302 303 304 305 |
# File 'uu_os-0.29.16/lib/uu/os/cast.rb', line 295 def get_cast_history_list(subject_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Cast) dto = Cast::CastGetCastHistoryList.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('getCastHistoryList', subject_uri) return UU::OS::REST::ResultList.new(Cast::CastGetCastHistoryList, Cast::CastHistoryAttributes, res) end end |
- (Array) get_cast_list(subject_uri, criteria = nil)
Returns list of casts to the specified subject (role or group). The list is sorted by the date of creation of a cast by default and due to backwards compatibility are returned only casts with IN cast direction by default.
109 110 111 112 113 114 115 116 117 118 119 |
# File 'uu_os-0.29.16/lib/uu/os/cast.rb', line 109 def get_cast_list(subject_uri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Cast) dto = Cast::CastGetCastList.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('getCastList', subject_uri) return UU::OS::REST::ResultList.new(Cast::CastGetCastList, Cast::CastAttributes, res) end end |
- (Object) set_attributes(subject_uri, cast = nil)
Sets basic attributes of the cast. Cast is not an entity, it is a relation between two subjects (and these two subjects identify the relation).
172 173 174 175 176 177 178 179 |
# File 'uu_os-0.29.16/lib/uu/os/cast.rb', line 172 def set_attributes(subject_uri, cast = nil) svc = UU::OS::REST::RemoteClient.new(Cast) payload = UU::OS::Cast::CastSetAttributes.new(cast).to_json UU::OS::QoS::QoSHandler.auto_retry do svc.post('setAttributes', subject_uri, payload) end end |
- (UU::OS::UESURI[]) verify_cast_existence(territoryUri, criteria = nil)
Verifies the cast existence of a user to a list of subjects in a given territory. The user is identified by either Universe ID or access role UESURI.
272 273 274 275 276 277 278 279 280 281 282 |
# File 'uu_os-0.29.16/lib/uu/os/cast.rb', line 272 def verify_cast_existence(territoryUri, criteria = nil) svc = UU::OS::REST::RemoteClient.new(Cast) dto = UU::OS::Cast::CastVerifyCastExistence.new(criteria) svc.add_parameter('castSubjectUri', dto.cast_subject_uri) svc.add_parameter('castSubjectUniverseId', dto.cast_subject_universe_id) svc.add_parameter('subjectUris', dto.subject_uris) UU::OS::QoS::QoSHandler.auto_retry do res = svc.get('verifyCastExistence', territoryUri) return JSON.parse(res) end end |