grant_privs

Grants the privileges to the existing Enterprise Manager user or Enterprise Manager Role.

Note:

To replace an existing Enterprise Manager administrator role, use the modify_role verb.

Format

emcli grant_privs
        -name="username|rolename"
        -privilege="name[;secure_resource_details]"
        [-grant_all_targets_on_host="yes|no"]
        [-separator=privilege="sep_string"]
        [-subseparator=privilege="subsep_string"]

[ ]  indicates that the parameter is optional

Options

  • name

    User name or role name to which privileges will be assigned.

  • privilege

    Privilege to be granted to the Enterprise Manager user or role. You can specify this option more than once.

    Specify secure_resource_details as:

    resource_guid|[resource_column_name1=resource_column_value1
    [:resource_column_name2=resource_column_value2]..]"
    

    Optionally, you can drop resource column names from this option if you provide resource information in the order described by emcli get_supported_privileges. See the "See Also" section below for more information.

  • grant_all_targets_on_host

    Indicates if the privilege needs to be granted on all targets of the host specified as part of the privilege parameter. The default value is no.

  • separator=privilege

    Specify a string delimiter to use between name-value pairs for the value of the -privilege option. The default separator delimiter is a semi-colon ( ; ).

  • subseparator=privilege

    Specify a string delimiter to use between the name and value in each name-value pair for the value of the -privilege option. The default subseparator delimiter is a colon ( : ).

Examples

Example 1

This example grants these privileges to user1:

  • Privilege to use any beacon

  • Full control of the jobs with ID 923470234ABCDFE23018494753091111

  • Full control on the target host1.example.com:host

  • Full control on the credential cred1:user2

  • View Privilege on target with ID 123451234ABCDFE23018494753092222

emcli grant_privs
      -name="user1"
      -privilege="USE_ANY_BEACON"
      -privilege="FULL_JOB;923470234ABCDFE23018494753091111"
      -privilege="FULL_TARGET;TARGET_NAME=host1.example.com:TARGET_TYPE=host"
      -privilege="FULL_CREDENTIAL;CRED_NAME=cred1:CRED_OWNER=user2"
      -privilege="FULL_CREDENTIAL;CRED_GUID=123451234ABCDFE23018494753092222"

Example 2

This example grants target privileges to EM Role : Role1:

emcli grant_privs
      -name="Role1"
      -privilege="FULL_TARGET;TARGET_NAME=host1.example.com:TARGET_TYPE=host"

See Also

To see the complete list of privileges and resource column names, execute the following command:

emcli get_supported_privileges

To see the list of SYSTEM privileges, which do require resource information:

emcli get_supported_privileges -type=SYSTEM

To see the list of TARGET privileges:

emcli get_supported_privileges -type=TARGET

To see the list of JOB privileges:

emcli get_supported_privileges -type=JOB