T4S4  18.2 C7549 A21431
Teamcenter Gateway for SAP S/4HANA API Reference
AM ITK functions

All ITK functions of group AM supported by T4x. More...

Functions

 AM_check_privilege ObjectTag PrivilegeString
 This function calls the ITK pipe server function AM_check_privilege to check the defined privilege for an object of the current user. Checks if the current user has the specified privilege on the specified object. The rule tree is traversed to determine whether the privilege is granted or not. The verdict is set to true if the privilege is granted and to false if the privilege is revoked. Note that the union of all the user's groups and roles is used and if the user is granted the privilege via any of these groups or roles, the verdict is specified as true. More...
 
 AM_check_users_privilege UserTag ObjectTag PrivilegeString
 This function calls the ITK pipe server function AM_check_users_privilege to check the defined privilege for an object of a given user. Checks if the specified user has the specified privilege on the specified object. The rule tree is traversed to determine whether the privilege is granted or not. The verdict is set to true if the privilege is granted and to false if the privilege is revoked. Note that the union of all the user's groups and roles is used and if the user is granted the privilege via any of these groups or roles, the verdict is specified as true. More...
 

Detailed Description

All ITK functions of group AM supported by T4x.

This group specifies all ITK functions of group AM for which wrappers have been defined in T4x

Function Documentation

◆ AM_check_privilege()

ITK::AM_check_privilege   ObjectTag PrivilegeString  

This function calls the ITK pipe server function AM_check_privilege to check the defined privilege for an object of the current user. Checks if the current user has the specified privilege on the specified object. The rule tree is traversed to determine whether the privilege is granted or not. The verdict is set to true if the privilege is granted and to false if the privilege is revoked. Note that the union of all the user's groups and roles is used and if the user is granted the privilege via any of these groups or roles, the verdict is specified as true.

Parameters
ObjectTagTag of object instance to be checked
PrivilegeStringChoices are READ, WRITE, DELETE, CHANGE, PROMOTE, DEMOTE, COPY, IMPORT, EXPORT, TRANSFER_IN and TRANSFER_OUT
Returns
List of ITK_ok (=0) and verdict (Logical flag specifying whether the privilege is granted or revoked) or list of ITK status and error message

Sample code sequence

1 set ItkStatus [::ITK::AM_check_privilege $ObjectTag "READ"]
2 puts "ItkStatus $ItkStatus"
3 if {[::ITK::isITK_ok $ItkStatus]} {
4  if {[lindex $ItkStatus 1] == 1} {
5  puts "XXXX"
6  puts "XXXX AM_check_privilege returns true for READ privilege"
7  puts "XXXX"
8  } else {
9  puts "XXXX"
10  puts "XXXX AM_check_privilege returns false for READ privilege"
11  puts "XXXX"
12  }
13 } else {
14  # any error
15  set ErrorNumber [::ITK::getITKStatusNumber $ItkStatusCode]
16  set ErrorMesssage [::ITK::getErrorMessage4Status $ItkStatusCode]
17  puts "XXXX"
18  puts "XXXX Call to ITK function 'AM_check_privilege' failed! Error code: $ErrorNumber - $ErrorMesssage"
19  puts "XXXX"
20 }

◆ AM_check_users_privilege()

ITK::AM_check_users_privilege   UserTag ObjectTag PrivilegeString  

This function calls the ITK pipe server function AM_check_users_privilege to check the defined privilege for an object of a given user. Checks if the specified user has the specified privilege on the specified object. The rule tree is traversed to determine whether the privilege is granted or not. The verdict is set to true if the privilege is granted and to false if the privilege is revoked. Note that the union of all the user's groups and roles is used and if the user is granted the privilege via any of these groups or roles, the verdict is specified as true.

Parameters
UserTagTag of user
ObjectTagTag of object instance to be checked
PrivilegeStringChoices are READ, WRITE, DELETE, CHANGE, PROMOTE, DEMOTE, COPY, IMPORT, EXPORT, TRANSFER_IN and TRANSFER_OUT
Returns
List of ITK_ok (=0) and verdict (Logical flag specifying whether the privilege is granted or revoked) or list of ITK status and error message

Sample code sequence

1 set ItkStatus [::ITK::AM_check_users_privilege $UserTag $ObjectTag "READ"]
2 puts "ItkStatus $ItkStatus"
3 if {[::ITK::isITK_ok $ItkStatus]} {
4  if {[lindex $ItkStatus 1] == 1} {
5  puts "XXXX"
6  puts "XXXX AM_check_users_privilege returns true for READ privilege"
7  puts "XXXX"
8  } else {
9  puts "XXXX"
10  puts "XXXX AM_check_users_privilege returns false for READ privilege"
11  puts "XXXX"
12  }
13 } else {
14  # any error
15  set ErrorNumber [::ITK::getITKStatusNumber $ItkStatusCode]
16  set ErrorMesssage [::ITK::getErrorMessage4Status $ItkStatusCode]
17  puts "XXXX"
18  puts "XXXX Call to ITK function 'AM_check_users_privilege' failed! Error code: $ErrorNumber - $ErrorMesssage"
19  puts "XXXX"
20 }