To add a user one has to define a user name and password while using the script API_SCURTY.CREATE_USER. However, this password needs to be changed during the first login. Furthermore, one has to define the user type, which can be one of the following: HU, GU & TU, which are explained here: Red Authorization Concept. Additionally, one can create a private sandbox while creating the user and define a quota for that sandbox. Adding a comment and an email, to which a notification is send upon successful creation of the user account, is optional.
EXCUTE SCRIPT API_SCURTY.CREATE_USER (
'testuser' -- p_user_name
,'HU' -- p_user_type
,'password' -- p_authentication
,false -- p_private_sbx
,null -- p_quota
,'test user - will be deleted' -- p_comment
, -- p_email
);
The newly created user account can be found in the view SCURTY.REP_ALL_USERS.
USER _NAME | USER _CONSUMER _GROUP | USER _AUTHENTICATION | USER _AUTH_ ID | PASSWORD _STATE | ACCOUNT _LOCKED | IS_HU | IS_GU | IS_TU | IS _VALID | USBX _STATUS | USBX _QUOTA _GB | USER _COMMENT |
---|---|---|---|---|---|---|---|---|---|---|---|---|
TESTUSER | (null) | PASSWORD | (null) | EXPIRED(GRACE) | false | true | false | false | true | (null) | (null) | test user - will be deleted |
To change any of the parameters assigned to a user by creation, one can use the script API_SCURTY.MANAGE_USER.
Here, one can enter the new value for all parameters which should be changed and enter a NULL-value for those parameters,
for which the already saved parameter values should be kept.
EXECUTE SCRIPT API_SCURTY.MANAGE_USER (
'TESTUSER' -- p_user_name
,null -- p_account_lock
,null -- p_authentication
,null -- p_expire
,null -- p_private_sbx
,null -- p_quota
,'test user - will be deleted, got changed' -- p_comment
);
Changes to the user account can also be seen in the view SCURTY.REP_ALL_USERS.
USER _NAME | USER _CONSUMER _GROUP | USER _AUTHENTICATION | USER _AUTH_ ID | PASSWORD _STATE | ACCOUNT _LOCKED | IS_HU | IS_GU | IS_TU | IS _VALID | USBX _STATUS | USBX _QUOTA _GB | USER _COMMENT |
---|---|---|---|---|---|---|---|---|---|---|---|---|
TESTUSER | (null) | PASSWORD | (null) | EXPIRED(GRACE) | false | true | false | false | true | (null) | (null) | test user - will be deleted, got changed |
To drop a user account one only has to provide the user name of the account that should be dropped to the script API_SCURTY.DROP_USER.
EXECUTE SCRIPT API_SCURTY.DROP_USER (
'testuser' -- p_user_name
);
After issuing this command NO user with the user name 'testuser' should exist in the view SCURTY.REP_ALL_USERS.