Module: UU::OS::AllFromOrganizationalUnitCast Deprecated

Extended by:
AllFromOrganizationalUnitCast
Included in:
AllFromOrganizationalUnitCast
Defined in:
uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast.rb,
uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast/all_from_organizational_unit_cast_exists.rb,
uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast/all_from_organizational_unit_cast_delete.rb,
uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast/all_from_organizational_unit_cast_create.rb,
uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast/all_from_organizational_unit_cast_attributes.rb,
uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast/all_from_organizational_unit_cast_get_cast_list.rb,
uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast/all_from_organizational_unit_cast_set_attributes.rb,
uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast/all_from_organizational_unit_cast_get_attributes.rb

Overview

Deprecated.

All From OU will not be used in the new authorization (v4).

Module All From Organizational Unit Cast.

Defined Under Namespace

Classes: AllFromOrganizationalUnitCastAttributes, AllFromOrganizationalUnitCastCreate, AllFromOrganizationalUnitCastDelete, AllFromOrganizationalUnitCastExists, AllFromOrganizationalUnitCastGetAttributes, AllFromOrganizationalUnitCastGetCastList, AllFromOrganizationalUnitCastSetAttributes

Constant Summary

PATH =

Service path

'uu/os/AllFromOrganizationalUnitCast'

Instance Method Summary (collapse)

Instance Method Details

- (Object) create(organizational_unit_uri, cast = nil)

Casts a subject (specified in the parameter casted_subject_uri) to the group All From Organizational Unit which is derived from specified organizational unit. Only cast between subject and group All From Organizational Unit from the same organizational unit is supported. Any change of user authorization resulting from the cast modification will take effect approximately after 15 minutes.

Examples:

# Cast a role to All From OU of its organizational unit
UU::OS::AllFromOrganizationalUnitCast.create('ues:TERRITORY:ORGANIZATIONAL_UNIT',
        :casted_subject_uri => 'ues:TERRITORY:ROLE',
        :level => 'ASSISTANCE'
)

Parameters:

  • organizational_unit_uri (String, UU::OS::UESURI)

    UESURI of the organizational unit from which is the group All From Organization Unit derived. Another subject is casted to the derived group.

  • cast (AllFromOrganizationalUnitCastCreate) (defaults to: nil)

    Object containing attributes of the cast

Options Hash (cast):

  • :casted_subject_uri (String, UU::OS::UESURI)

    UESURI of the subject (role or group) which is to be casted to the group All From Organizational Unit identified by the command main entity. Never nil.

  • :level (String, UU::OS::Cast::CastLevel)

    The level of the new cast relation. If nil is set EXECUTIVE level is used.

  • :date_to (String)

    The informative field describing the date when the cast should expire. If nil is set, no date is set.



40
41
42
43
44
45
46
47
# File 'uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast.rb', line 40

def create(organizational_unit_uri, cast = nil)
  svc = UU::OS::REST::RemoteClient.new(AllFromOrganizationalUnitCast)
  payload = UU::OS::AllFromOrganizationalUnitCast::AllFromOrganizationalUnitCastCreate.new(cast).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('create', organizational_unit_uri, payload)
  end
end

- (Object) delete(organizational_unit_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.

Examples:

# Delete a cast to All From OU
UU::OS::AllFromOrganizationalUnitCast.delete('ues:TERRITORY:ORGANIZATIONAL_UNIT', :casted_subject_uri => 'ues:TERRITORY:ROLE')

Parameters:

  • organizational_unit_uri (String, UU::OS::UESURI)

    UESURI of the organizational unit from which is the group All From Organization Unit derived.

  • cast (AllFromOrganizationalUnitCastDelete) (defaults to: nil)

    Object containing UESURI of the casted subject.

Options Hash (cast):

  • :casted_subject_uri (String, UU::OS::UESURI)

    UESURI of the subject (role or group) which is casted to the group All From Organizational Unit identified by the command main entity. Cannot be nil.



138
139
140
141
142
143
144
145
# File 'uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast.rb', line 138

def delete(organizational_unit_uri, cast = nil)
  svc = UU::OS::REST::RemoteClient.new(AllFromOrganizationalUnitCast)
  payload = UU::OS::AllFromOrganizationalUnitCast::AllFromOrganizationalUnitCastDelete.new(cast).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('delete', organizational_unit_uri, payload)
  end
end

- (Boolean) exists(organizational_unit_uri, cast)

Checks whether the subject (specified in the parameter casted_subject_uri) is casted to the group All From Organizational Unit which is derived from the specified organizational unit.

Examples:

# Check direct cast existence (the role has cast to All From Organizational Unit derived from ORGANIZATIONAL_UNIT).
UU::OS::AllFromOrganizationalUnitCast.exists('ues:TERRITORY:ORGANIZATIONAL_UNIT', :casted_subject_uri => 'ues:TERRITORY:ROLE')

# Check indirect access role cast existence (the access role has cast to a role which has cast to All From Organizational Unit derived from ORGANIZATIONAL_UNIT).
UU::OS::AllFromOrganizationalUnitCast.exists('ues:TERRITORY:ORGANIZATIONAL_UNIT', :casted_subject_uri => 'ues:TERRITORY:ACCESS_ROLE', :recursive => true)

Parameters:

Options Hash (cast):

  • :casted_subject_uri (String, UU::OS::UESURI)

    UESURI of the subject (role or group) which is casted to the group All From Organizational Unit identified by the command main entity. Cannot be nil.

  • :recursive (Boolean)

    Flag indicating whether the uuCommand checks indirect cast existence. In current uuCommand version it is possible to check indirect cast only for access roles. Default value is false.

Returns:

  • (Boolean)

    True if cast exists, else false.



165
166
167
168
169
170
171
172
173
174
# File 'uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast.rb', line 165

def exists(organizational_unit_uri, cast)
  svc = UU::OS::REST::RemoteClient.new(AllFromOrganizationalUnitCast)
  dto = UU::OS::AllFromOrganizationalUnitCast::AllFromOrganizationalUnitCastExists.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', organizational_unit_uri)
    return (res == 'true') || (res == '"true"')
  end
end

- (AllFromOrganizationalUnitCastAttributes) get_attributes(organizational_unit_uri, cast)

Returns attributes of subject cast into the group All From Organizational Unit which is derived from specified organizational unit.

Examples:

# Get attributes of a cast to All From OU
attributes = UU::OS::AllFromOrganizationalUnitCast.get_attributes('ues:TERRITORY:ORGANIZATIONAL_UNIT',
        :casted_subject_uri => 'ues:TERRITORY:ROLE'
)

Parameters:

Options Hash (cast):

  • :casted_subject_uri (String, UU::OS::UESURI)

    UESURI of the subject (role or group) which is casted to the group All From Organizational Unit identified by the command main entity. Cannot be nil.

Returns:



64
65
66
67
68
69
70
71
72
# File 'uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast.rb', line 64

def get_attributes(organizational_unit_uri, cast)
  svc = UU::OS::REST::RemoteClient.new(AllFromOrganizationalUnitCast)
  get_dto = UU::OS::AllFromOrganizationalUnitCast::AllFromOrganizationalUnitCastGetAttributes.new(cast)
  svc.add_parameter('castedSubjectUri', get_dto.casted_subject_uri)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getAttributes', organizational_unit_uri)
    return AllFromOrganizationalUnitCast::AllFromOrganizationalUnitCastAttributes.new(res)
  end
end

- (Array) get_cast_list(organizational_unit_uri, criteria = nil)

Returns list of casts according to the group All From Organizational Unit which is derived from the specified organizational unit. The result list can be filtered and ordered by the following attributes: level, dateFrom, state, castedSubjectName, castedSubjectCode, castedSubjectEntityTypeUri. The list is sorted by the date of creation of casts (dateFrom) by default.

Examples:

# Returns list of casts which have executive level
UU::OS::AllFromOrganizationalUnitCast.get_cast_list('ues:TERRITORY:ORGANIZATIONAL_UNIT', :query => 'level="EXECUTIVE"')

Parameters:

Options Hash (criteria):

  • :query (String)

    Query for filtering and ordering of the result list (more information in uuQuery - Guideline). It is possible to filter and order the result list by castedSubjectName, castedSubjectCode, dateFrom, state, level and castedSubjectEntityTypeUri.

Returns:



89
90
91
92
93
94
95
96
97
98
99
# File 'uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast.rb', line 89

def get_cast_list(organizational_unit_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(AllFromOrganizationalUnitCast)
  dto = AllFromOrganizationalUnitCast::AllFromOrganizationalUnitCastGetCastList.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', organizational_unit_uri)
    return UU::OS::REST::ResultList.new(AllFromOrganizationalUnitCast::AllFromOrganizationalUnitCastGetCastList, AllFromOrganizationalUnitCast::AllFromOrganizationalUnitCastAttributes, res)
  end
end

- (Object) set_attributes(organizational_unit_uri, cast = nil)

Sets basic attributes of the subject cast into the All From Organizational Unit which is derived from the specified organizational unit.

Examples:

# Change cast level of a cast to All From OU
UU::OS::AllFromOrganizationalUnitCast.set_attributes('ues:TERRITORY:ORGANIZATIONAL_UNIT',
        :casted_subject_uri => 'ues:TERRITORY:ROLE',
        :level => UU::OS::Cast::CastLevel::ASSISTANCE
)

Parameters:

Options Hash (cast):

  • :casted_subject_uri (String, UU::OS::UESURI)

    UESURI of the subject (role or group) which is casted to the group All From Organizational Unit identified by the command main entity. Cannot be nil.

  • :level (String, UU::OS::Cast::CastLevel)

    The new level of the cast relation. If nil is set the level is not changed.

  • :date_to (String)

    The informative field describing the date when the cast should expire. Note that there is no business logic behind this field at the moment, so it serves only as a note. If nil is set, the date is not changed.

  • :state (String, UU::OS::Cast::CastState)

    The new state of the cast. Only ACTIVE casts are involved in the business rules computations. If nil is set, the state is not changed.



118
119
120
121
122
123
124
125
# File 'uu_os-0.29.16/lib/uu/os/all_from_organizational_unit_cast.rb', line 118

def set_attributes(organizational_unit_uri, cast = nil)
  svc = UU::OS::REST::RemoteClient.new(AllFromOrganizationalUnitCast)
  payload = UU::OS::AllFromOrganizationalUnitCast::AllFromOrganizationalUnitCastSetAttributes.new(cast).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('setAttributes', organizational_unit_uri, payload)
  end
end