context Command

Setting context identifies the user and which areas of access the current user maintains.

This page discusses:

User Level

Business Administrator

Syntax

The command uses this syntax.

[set|push|pop|print|monitor]context [CLAUSE];

  • CLAUSEs provide additional information about context.

Set Context

Context is controlled with the Set Context command which identifies a user by specifying the person name and vault.

set context [ITEM {ITEM}];
  • ITEM is a Set Context clause.

The Set Context clauses provide more information about the context you are setting. They are:

person PERSON_NAME
password VALUE
newpassword VALUE
vault VAULT_NAME
role ROLE_NAME
vault VAULT_NAME
user
tenant TENANTNAME

The Person clause can be replaced with the User clause. In both cases a defined person must be entered. A group or role is not allowed.

Using the role clause, programmers can provide a means for users to specify their role when setting context using MQL or Studio Customization Toolkit (see javadoc for specifics on Studio Customization Toolkit classes). The role has an effect on access ONLY if there are access filters in place that reference the entered role value with the context.role selectable.

A context role remains valid only for the session for which it was set. Within a session a context role can be changed anytime by setting a new context.

When resetting a context, if the user specifies a role that does not exist, then the previous context and role are retained.

For example, suppose only users with the PRODesigner role have access to project PRO objects and only users with CIMDesigner role have access to the project CIM objects. User Ted initially starts a session with the role PRODesigner to access the PRO project.

set context user Ted password *** role PRODesigner;

Now, if he wants to access the project CIM, he can reset his context and login using the CIMDesigner role.

set context user Ted password *** role CIMDesigner; 

How you set the context varies based on whether the person definition includes a Password, No Password, or Disable Password clause. For more information, seeWorking with User Context.

Push Context

The push context command changes the context to the specified person and places the current context onto a stack so that it can be recovered by a pop context command.

Push context can also be issued with no additional clauses, in which case the current context would be placed on the stack, but the current context would be unchanged. The command syntax is:

push context [person PERSON_NAME] [password VALUE] [vault VAULT_NAME];

Pop Context

The pop context command takes the last context from the stack and makes it current.

pop context;