Network Deployment (Distributed operating systems), v8.0 > Reference > Commands (wsadmin scripting)
addUserToTopicRole command
Use the addUserToTopicRole command to add a user to a topic role within a specified topic space.
To run the command, use the AdminTask object of the wsadmin scripting client.
This command is valid only when used with WAS v7.0 or later application servers. Do not use it with earlier versions.
Command-line help is provided for service integration bus commands:
- For a list of the available service integration bus security commands in Jython and a brief description of each command, run at the wsadmin prompt:
print AdminTask.help('SIBAdminBusSecurityCommands')
- For overview help on a given command, run at the wsadmin prompt:
print AdminTask.help('command_name')
After using the command, save changes to the master configuration; for example, by using the following command:
AdminConfig.save()
Use the addUserToTopicRole command to add a user to the sender or receiver roles for a topic anywhere in the topic hierarchy for a local bus. The roles that you specify for the topic are additional to any roles that the topic inherits from its parent in the topic hierarchy. We can use this command to define the access control policy for a topic that does not yet exist. By defining the access control policy first, you ensure that the topic is secure from the moment it is created.
Target object
None
Required parameters
-bus busName
The name of the local bus. We can use the listSIBuses command to list the names of existing buses.
-topicSpace topicSpaceName
The name of the topic space.
-topic topicName
The name of the topic.
-role roleName
We can specify the Sender or Receiver roles for a topic.
-user userName
The name of the user to add to the Sender or Receiver roles for a topic.
Conditional parameters
None
Optional parameters
-uniqueName uniqueName
Specify the name that uniquely defines the user in the user registry. If an LDAP user registry is in use, the unique name is the distinguished name (DN) for the user. We can specify values for both -uniqueName and -user, but ensure that they identify the same user. The command does not check that the values match.
Example
The following example adds a user called User1, to the Sender role for a topic called football, in the topic space called Sport, on a local bus called Bus1.
Admintask.addUserToTopicRole ('[-bus Bus1 -topicSpace Sport -topic football -role Sender -user User1]')
Messaging security
Topic security
Role-based authorization
Add users and groups to topic roles