QPR Knowledge Base 2017.1

SetAccessLevel

SetAccessLevel

Previous topic Next topic No directory for this topic  

SetAccessLevel

Previous topic Next topic Topic directory requires JavaScript Mail us feedback on this topic!  

Revision history:

Introduced in QPR 8.1

 

Sets object rights for a user or a group. This function is supported only for objects in the SC namespace

 

Synopsis:

 

void SetAccessLevel(string sessionId, string objectIds, string userIds, AccessLevel accessLevel, bool removeAccess, string options)

 

Return Value:

 

None.

 

Parameters:

 

sessionId: String. ID of an authenticated session.

objectIds: String. A comma-separated list of FullID's of objects to which the access level is set. This parameter supports also the following special ID's:

SC.<model>.-2 = user element type

SC.<model>.-3 = scorecard element type

SC.<model>.-7 = information item element type

userIds: String. A comma-separated list of login names or FullID's of users and groups

accessLevel: Value of an enumerated type with the following values: -3 = Model Administrator, -2 = Model User, -1 = None, 0 = View, 1 = Update, 2 = Full. Note: Values -3 and -2 are valid only for models. -1, 0, 1, 2 are valid only for model objects.

removeAccess: Boolean. Defines whether access is removed from user or added to user. Note: When removing access for model objects, the accessLevel value is ignored.

options: String. A comma-separated list of options for the command. Note that there can be also mandatory options specific to product and object type.

 

Example Procedure:

 

ServiceClient client = new ServiceClient("WSHttpBinding_IService");

string sessionId = client.Authenticate("qpr", "demo");

client.SetAccessLevel(sessionId, "SC.1938773693.281", "CEO", AccessLevel.View, false, "");

client.LogOff(sessionId);

client.Close();