SetObjectRights
|
||
Revision history:
Introduced in QPR 7.6.1 SP2
Sets object rights to an element for a user or a group.
Synopsis:
PGModel.SetObjectRights(ElementId, User, Parameters, Rights)
Parameters:
ElementID: Integer. ElementId must refer to a subprocess element in the model. If Element ID = 0, it refers to the main process level.
User: String | ID. User name | User id | Group name | Group Id.
Parameters: String. A semicolon-separated list of parameters. The supported parameter:
• | ApplyToChildLevels: true | 1 | false | 0. If true, rights are set to the process level defined by ElementId and all process levels under that recursively. The default value is false. |
Rights: Integer; none (0), view (1), update (2), full (3), admin (4). Note however that QPR ProcessGuide does not have object-specific update rights so this option is available only for compatibility. User rights cannot be set for administrator users or groups.
Required Rights:
Administrator or Model Administrator rights to the model.
Return Values:
Below are listed the return values that this function can return:
RV_NOT_ENOUGH_RIGHTS
RV_ELEMENT_IS_NOT_SUBPROCESS
RV_INVALID_PARAMETER
RV_USER_NOT_FOUND
RV_CANNOT_SET_RIGHTS_FOR_ADMINISTRATORS
RV_CANNOT_SET_RIGHTS_LOWER_OR_SAME_THAN_INHERITED_RIGHTS
RV_SUCCESS
Example Procedure:
Sub SetObjectRightsForUser()
Dim iResult
iResult = PGModel.SetObjectRights(0, "USER/GROUP NAME", "ApplyToChildLevels=true", 1)
If (iResult <> 0) Then
MsgBox("Setting object rights failed: " & PGApplication.GetErrorMessage(iResult))
Else
MsgBox("Rights Applied")
End If
End Sub