Module: UU::OS::Cast
- Extended by:
- Cast
- Included in:
- Cast
- Defined in:
- uu_os_client-0.10.6/lib/uu/os/cast.rb,
uu_os_client-0.10.6/lib/uu/os/cast/cast_state.rb,
uu_os_client-0.10.6/lib/uu/os/cast/cast_level.rb,
uu_os_client-0.10.6/lib/uu/os/cast/cast_create.rb,
uu_os_client-0.10.6/lib/uu/os/cast/cast_delete.rb,
uu_os_client-0.10.6/lib/uu/os/cast/cast_exists.rb,
uu_os_client-0.10.6/lib/uu/os/cast/cast_direction.rb,
uu_os_client-0.10.6/lib/uu/os/cast/cast_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/cast/cast_get_cast_list.rb,
uu_os_client-0.10.6/lib/uu/os/cast/cast_get_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/cast/cast_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/cast/cast_access_role_attributes.rb,
uu_os_client-0.10.6/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, CastGetCastList, CastLevel, CastSetAttributes, CastState
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)
This command deletes the cast from the system.
-
- (Boolean) exists(subject_uri, cast)
The uuCommand checks whether the role (specified in casted_subject_parameter) has cast to another role (specified in subject_uri parameter as main entity).
-
- (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)
This command returns attributes of one cast.
-
- (Array) get_cast_list(subject_uri, criteria = nil)
The uuCommand returns list of casts to the specified subject (role or group).
-
- (Object) set_attributes(subject_uri, cast = nil)
Sets basic attributes of the cast.
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:
36 37 38 39 40 41 42 43 |
# File 'uu_os_client-0.10.6/lib/uu/os/cast.rb', line 36 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)
This command 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).
139 140 141 142 143 144 145 146 |
# File 'uu_os_client-0.10.6/lib/uu/os/cast.rb', line 139 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)
The uuCommand checks whether the role (specified in casted_subject_parameter) has cast to another role (specified in subject_uri parameter as main entity). Only direct cast existence is checked by default. In current uuCommand version it is possible to check indirect cast only for access roles.
166 167 168 169 170 171 172 173 174 175 |
# File 'uu_os_client-0.10.6/lib/uu/os/cast.rb', line 166 def exists(subject_uri, cast) 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('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.
103 104 105 106 107 108 109 110 111 112 113 |
# File 'uu_os_client-0.10.6/lib/uu/os/cast.rb', line 103 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)
This command returns attributes of one cast. Cast is identified by two subjects. The main entity (a subject to which the other is casted) and parameter castedSubjectUri in the DTO (the casted subject).
53 54 55 56 57 58 59 60 61 |
# File 'uu_os_client-0.10.6/lib/uu/os/cast.rb', line 53 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_list(subject_uri, criteria = nil)
The uuCommand 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 UU::OS::Cast::CastDirection::IN cast direction by default.
castedSubjectName, castedSubjectCode, dateFrom, state, level, primary and castDirection.
77 78 79 80 81 82 83 84 85 86 87 |
# File 'uu_os_client-0.10.6/lib/uu/os/cast.rb', line 77 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).
120 121 122 123 124 125 126 127 |
# File 'uu_os_client-0.10.6/lib/uu/os/cast.rb', line 120 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 |