Users

Please note JavaScript support is exclusive to SEAR 0.7.0 and later.

Valid operators for this type of request

Operator Valid
add
alter
delete
extract
search

Extracting information

SEAR provides the extract and search operators to gather information about users.

Extracting a specific RACF user

Below you can find a sample of some code that extracts information about the RACF user FDEGILIO.

'use strict';

import { sear } from '@mainframe-renewal-project/searjs';

const request = {
  "operation": "extract",
  "admin_type": "user",
  "userid": "FDEGILIO",
};

const response = sear(request, true);

console.log(JSON.stringify(response.result, null, 2));

Returned result

{
  "profile": {
    "base": {
      "base:audit_logging": false,
      "base:read_only_auditor": false,
      "base:auditor": false,
      "base:automatic_dataset_protection": false,
      "base:create_date": "09/13/24",
      "base:default_group": "SYS1",
      "base:group_connections": [
        {
          "base:group_connection_auditor": false,
          "base:group_connection_automatic_dataset_protection": false,
          "base:group_connection_create_date": "09/13/24",
          "base:group_connection_dataset_access": false,
          "base:group_connection_group": "SYS1",
          "base:group_connection_last_connect_date": null,
          "base:group_connection_last_connect_time": null,
          "base:group_connection_operations": false,
          "base:group_connection_owner": "LEONARD",
          "base:group_connection_resume_date": null,
          "base:group_connection_revoke_date": null,
          "base:group_connection_revoked": false,
          "base:group_connection_special": false,
          "base:group_connection_universal_access": "NONE",
          "base:group_connection_used_count": 0
        }
      ],
      "base:group_dataset_access": false,
      "base:has_passphrase": false,
      "base:has_password": false,
      "base:logon_allowed_days": [
        {
          "base:logon_allowed_day": "SUNDAY"
        },
        {
          "base:logon_allowed_day": "MONDAY"
        },
        {
          "base:logon_allowed_day": "TUESDAY"
        },
        {
          "base:logon_allowed_day": "WEDNESDAY"
        },
        {
          "base:logon_allowed_day": "THURSDAY"
        },
        {
          "base:logon_allowed_day": "FRIDAY"
        },
        {
          "base:logon_allowed_day": "SATURDAY"
        }
      ],
      "base:logon_allowed_time": "ANYTIME",
      "base:mfa_password_fallback": false,
      "base:name": "Frank DeGilio",
      "base:operations": false,
      "base:owner": "FDEGILIO",
      "base:passphrase_change_interval": 0,
      "base:passphrase_enveloped": false,
      "base:password_change_interval": 186,
      "base:password_enveloped": false,
      "base:protected": true,
      "base:restrict_global_access_checking": false,
      "base:revoked": false,
      "base:special": false
    },
    "omvs": {
      "omvs:home_directory": "/u/fdegilio",
      "omvs:uid": 24
    }
  },
  "return_codes": {
    "racf_reason_code": 0,
    "racf_return_code": 0,
    "saf_return_code": 0,
    "sear_return_code": 0
  }
}

Searching for RACF users

Getting a list of all users on the system

The sample below gets a list of all users on the system.

'use strict';

import { sear } from '@mainframe-renewal-project/searjs';

const request = {
  "operation": "search",
  "admin_type": "user",
};

const response = sear(request, true);

console.log(JSON.stringify(response.result, null, 2));

Filtering search results for a specific user

The sample below gets all users that start with ZWE. It will return a list of users, to get metadata on them you will have to run the extract operation on every single RACF user in the list.

'use strict';

import { sear } from '@mainframe-renewal-project/searjs';

const request = {
  "operation": "search",
  "admin_type": "user",
  "userid_filter": "ZWE",
};

const response = sear(request, true);

console.log(JSON.stringify(response.result, null, 2));

Updating RACF users

SEAR provides 3 main operators for updating the RACF database, add, alter, and delete.

Creating a new RACF user

The sample below creates a user called ESWIFT with the base name of ELIJAH SWIFT, a UID of 24, and the home directory set to /home/ESWIFT.

'use strict';

import { sear } from '@mainframe-renewal-project/searjs';

const request = {
  "operation": "add",
  "admin_type": "user",
  "userid": "ESWIFT",
  "traits": {
    "base:name": "ELIJAH SWIFT",
    "omvs:uid": 24,
    "omvs:home_directory": "/home/ESWIFT",
  },
};

const response = sear(request, true);

console.log(JSON.stringify(response.result, null, 2));

You can see the full list of traits in the traits/user section

Altering a RACF user

The sample below gives special and read only auditor attributes to the RACF user LEONARD.

'use strict';

import { sear } from '@mainframe-renewal-project/searjs';

const request = {
  "operation": "alter",
  "admin_type": "user",
  "userid": "LEONARD",
  "traits": {
    "base:name": "LEONARD CARCARAMO",
    "base:special": true,
    "base:read_only_auditor": true,
  },
};

const response = sear(request, true);

console.log(JSON.stringify(response.result, null, 2));

You can see the full list of traits in the traits/user section

Deleting a RACF user

The below sample deletes the RACF user LEONARD.

'use strict';

import { sear } from '@mainframe-renewal-project/searjs';

const request = {
  "operation": "delete",
  "admin_type": "user",
  "userid": "LEONARD",
};

const response = sear(request, true);

console.log(JSON.stringify(response.result, null, 2));

This site uses Just the Docs, a documentation theme for Jekyll.