Module: UU::OS::AccessRole Deprecated

Extended by:
AccessRole
Included in:
AccessRole
Defined in:
uu_os_client-0.10.6/lib/uu/os/access_role.rb,
uu_os_client-0.10.6/lib/uu/os/access_role/access_role_create.rb,
uu_os_client-0.10.6/lib/uu/os/access_role/access_role_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/access_role/access_role_set_attributes.rb,
uu_os_client-0.10.6/lib/uu/os/access_role/access_role_add_role_interface.rb,
uu_os_client-0.10.6/lib/uu/os/access_role/access_role_remove_role_interface.rb,
uu_os_client-0.10.6/lib/uu/os/access_role/access_role_get_role_interface_list.rb,
uu_os_client-0.10.6/lib/uu/os/access_role/access_role_get_role_interface_list_item.rb

Overview

Deprecated.

Use PersonalAccessRole instead.

Access Role service.

Defined Under Namespace

Classes: AccessRoleAddRoleInterface, AccessRoleAttributes, AccessRoleCreate, AccessRoleGetRoleInterfaceList, AccessRoleGetRoleInterfaceListItem, AccessRoleRemoveRoleInterface, AccessRoleSetAttributes

Constant Summary

PATH =

Service path of the REST API.

'ues/core/role/UESAccessRole'

Instance Method Summary (collapse)

Instance Method Details

- (Object) activate_access(access_role_uri)

This command activates an access role. The access role will have access to its territory.

Parameters:

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

    UESURI of an access role that the access will be reactivated.



147
148
149
150
151
152
# File 'uu_os_client-0.10.6/lib/uu/os/access_role.rb', line 147

def activate_access(access_role_uri)
  svc = UU::OS::REST::RemoteClient.new(AccessRole)
  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('activateAccess', access_role_uri)
  end
end

- (Object) add_role_interface(access_role_uri, access_role = nil)

This command creates new role interface connection to the specified access role. The role interface has to be in an active state and mustn't be already connected. The role interface has to be connected to the one of the authorized roles for this command, or the authorized role has to be casted to the default group of meta model where the role interface is located.

Parameters:

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

    UESURI of the access role where the role interface will be connected

  • access_role (AccessRoleAddRoleInterface) (defaults to: nil)

    DTO containing role interface that to be connected



124
125
126
127
128
129
130
131
# File 'uu_os_client-0.10.6/lib/uu/os/access_role.rb', line 124

def add_role_interface(access_role_uri, access_role = nil)
  svc = UU::OS::REST::RemoteClient.new(AccessRole)
  payload = UU::OS::AccessRole::AccessRoleAddRoleInterface.new(access_role).to_json

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

- (UU::OS::UESURI) create(location_uri, access_role = nil)

Creates a new access role. The command creates a new access role in aspecified location. At the very least meta artifact must bespecified in AccessRoleCreate DTO. Competent role for the new role will be selected as the most suitable according to the specified container and meta artifact (executive/authorized role with connected interface), or can be also specified in AccessRoleCreate DTO.

Parameters:

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

    UESURI of the folder/org. unit/meta model where the access role will be created.

  • access_role (AccessRoleCreate) (defaults to: nil)

    DTO containing attributes of the new access role

Returns:

  • (UU::OS::UESURI)

    UESURI of the new access role @raise UESAccessRoleRTException



67
68
69
70
71
72
73
74
75
# File 'uu_os_client-0.10.6/lib/uu/os/access_role.rb', line 67

def create(location_uri, access_role = nil)
  svc = UU::OS::REST::RemoteClient.new(AccessRole)
  payload = UU::OS::AccessRole::AccessRoleCreate.new(access_role).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('create', location_uri, payload)
    return UU::OS::UESURI.new(res)
  end
end

- (Object) deactivate_access(access_role_uri)

This command deactivates an access role. The access role will lose access to its territory.

Parameters:

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

    UESURI of an access role that the access will be canceled.



137
138
139
140
141
142
# File 'uu_os_client-0.10.6/lib/uu/os/access_role.rb', line 137

def deactivate_access(access_role_uri)
  svc = UU::OS::REST::RemoteClient.new(AccessRole)
  UU::OS::QoS::QoSHandler.auto_retry do
    svc.post('deactivateAccess', access_role_uri)
  end
end

- (AccessRoleAttributes) get_attributes(access_role_uri)

This command returns attributes representing the personal access role specified by the access_role_uri parameter. The command does not change the state of the role in the system.

Parameters:

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

    UESURI of a personal access role whose attributes are returned

Returns:



31
32
33
34
35
36
37
# File 'uu_os_client-0.10.6/lib/uu/os/access_role.rb', line 31

def get_attributes(access_role_uri)
  svc = UU::OS::REST::RemoteClient.new(AccessRole)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('getAttributes', access_role_uri)
    return AccessRole::AccessRoleAttributes.new(res)
  end
end

- (UU::OS::REST::ResultList<AccessRole::AccessRoleGetRoleInterfaceList, AccessRole::AccessRoleGetRoleInterfaceListItem>) get_role_interface_list(access_role_uri, criteria = nil)

Returns list of the role interfaces that are connected to the specified access role. The list of returned interfaces could be filtered by the name or code. Returned list does not contain any objects filtered out by executed UESQuery. The list is sorted by the name (and by code in case are equal) of an interface by default.

Available parameters are: name and code

See UESQuery Documentation.

Parameters:

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

    UESURI of the access role for which the connected role interfaces are to be listed

  • criteria (AccessRoleGetRoleInterfaceList) (defaults to: nil)

    DTO containing criteria for listing access role interfaces.

Returns:



90
91
92
93
94
95
96
97
98
99
100
# File 'uu_os_client-0.10.6/lib/uu/os/access_role.rb', line 90

def get_role_interface_list(access_role_uri, criteria = nil)
  svc = UU::OS::REST::RemoteClient.new(AccessRole)
  dto = AccessRole::AccessRoleGetRoleInterfaceList.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('getRoleInterfaceList', access_role_uri)
    return UU::OS::REST::ResultList.new(AccessRole::AccessRoleGetRoleInterfaceList, AccessRole::AccessRoleGetRoleInterfaceListItem, res)
  end
end

- (Object) remove_role_interface(access_role_uri, access_role = nil)

The command removes role interface connection from the specified access role. Only connected interfaces can be disconnected from the access role.

Parameters:

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

    UESURI of the access role where the role interface will be disconnected

  • access_role (AccessRoleRemoveRoleInterface) (defaults to: nil)

    DTO containing role interface that to be disconnected



107
108
109
110
111
112
113
114
# File 'uu_os_client-0.10.6/lib/uu/os/access_role.rb', line 107

def remove_role_interface(access_role_uri, access_role = nil)
  svc = UU::OS::REST::RemoteClient.new(AccessRole)
  payload = UU::OS::AccessRole::AccessRoleRemoveRoleInterface.new(access_role).to_json

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

- (UU::OS::UESURI) set_attributes(access_role_uri, access_role = nil)

Command for setting attributes of an access role. The command can't modify references to objects like location, competent role and so on.

Parameters:

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

    UESURI of the access role whose attributes are to be changed

  • access_role (AccessRoleSetAttributes) (defaults to: nil)

    DTO containing new attributes theaccess role

Returns:



46
47
48
49
50
51
52
53
54
# File 'uu_os_client-0.10.6/lib/uu/os/access_role.rb', line 46

def set_attributes(access_role_uri, access_role = nil)
  svc = UU::OS::REST::RemoteClient.new(AccessRole)
  payload = UU::OS::AccessRole::AccessRoleSetAttributes.new(access_role).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('setAttributes', access_role_uri, payload)
    return UU::OS::UESURI.new(res)
  end
end