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 |
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 or when the PATROL Agent cannot connect to an RT server or console server.
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. For more information about the ac_cs_default.mof file, see the PATROL Console Server User Guide.
PATROL Permissions
Permission Type | Permissions |
---|---|
PATROL Agent Permissions | BMC_PRIV_PATROL_AGENT_LOAD_KM |
PATROL Console Server Permissions | BMC_PRIV_PATROL_CSERVER_HANDLE_AGENT |
PATROL Central - Windows Edition Permissions | BMC_PRIV_PATROL_BMCIC_LOAD_KM_IDE |
PATROL Central - Web Edition Permissions | BMC_PRIV_PATROL_PWC_CORE_VIEW |
PATROL End-to-End Response Timer Permissions | BMC_PRIV_PATROL_ETE_VIEW |
PATROL Event Manager Permissions | BMC_PRIV_PATROL_PEM_OPER |
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: