sec_check_priv
Determine whether a user name has the permission required to run a menu command.
Syntax
Parameter
Parameter | Definition |
|---|---|
user_name | user name that runs a menu command |
permission | permission required to run a menu command *Valid Values* |
time_out | integer specifying a time limit (in seconds) for sec_check_priv() to return a value Entering a 0 fortime_out gives sec_check_priv() an infinite amount of time to return a value. Valid Values Default 300 |
Description
The sec_check_priv() function determines whether the user name that runs a menu command has the proper permission to proceed. If the user name has the permission, the function returns a 1, else it returns 0.
If sec_check_priv() cannot determine whether the user name has the permission, it returns a 1 instead of possibly denying access to a user name that has the proper permission. Usually sec_check_priv() cannot determine the permission when the time_out period expires.
The following table shows a representative sample of PATROL permissions that you can use as the permission parameter. For a complete list of these permissions, see the ac_cs_default.mof file.
PATROL Permissions
Permission Type | Permissions |
|---|---|
PATROL Agent Permissions | BMC_PRIV_PATROL_AGENT_LOAD_KM |
PATROL End-to-End Response Timer Permissions | BMC_PRIV_PATROL_ETE_VIEW |
Example
The following example demonstrates the sec_check_priv() function:
# Insert procedure to shutdown agent.
print("PATROL Agent was successfully shutdown.");
}
else {
print("Permission denied.");
}
The previous example has the following output: