Skip to content

Add API(s) for getting user's special authorities #11

Description

@kadler

I think it should work something like this:

// sort of modeled after getpwnam/getpwuid
int get_special_authorities_uid(uid_t uid);
int get_special_authorities_nam(const char* name);

int auth = get_special_authorities_uid(0); // QSECOFR
assert(auth & AUTH_ALLOBJ);

int auth = get_special_authorities("*CURRENT");
if (auth & AUTH_JOBCTL) printf("Current user has *JOBCTL\n");

The API would be based on QSYUSRI.

@ThePrez had a previous attempt when it was on BitBucket: https://bitbucket.org/litmis/portlibfori/pull-requests/1/checkspcaut/diff That went a different way, using QSYCUSRS instead. The semantics are slightly different between these two approaches.

QSYUSRI tells which authorities are given to a user profile object outright, but an MI program can adopt or drop authorites so the authorities checked by QSYCUSRS could be different for the same user when called by different programs. PASE does not support adopted authority, though, so it's largely irrelevant unless you're calling in to PASE from ILE, which isn't very common. For any program started from PASE, it will only have the authorities specified by the user profile that it was started under.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions