Please enable JavaScript to view this site.

QPR Knowledge Base 2023.1

  •      
  • Navigation: Developer's Guide > QPR API > The Object Model > QPR Metrics > SCModel Commands

    SetObjectRights

    Scroll Prev Top Next More

    Revision history:

    Introduced in QPR 7.2.1

    Last changed in QPR 7.4.1

     

    Set rights to an element type for a user or a group.

     

    Synopsis:

     

    SCModel.SetObjectRights(ElementId, UserName, Rights)

     

    Parameters:

     

    ElementId: Integer

    UserName: String. Login name of a user or name of a group

    Rights: Integer: 0=None, 1=View, 2=Update, 3=Full

     

    Required Rights:

     

    Administrator or Model Administrator rights to the SCModel.

     

    Return Values:

    Below are listed the return values that this function can return:

     

    RV_SUCCESS

    RV_MODEL_NOT_OPEN

    RV_NO_RIGHTS

    RV_INVALID_ACCESSLEVEL

    RV_INVALID_ELEMENT_TYPE

    RV_USER_NOT_FOUND

    RV_COULD_NOT_START_TRANSACTION

    RV_OBJECT_NOT_FOUND

    RV_UNKNOWN_ERROR

     

    Example Procedure:

     

    iRet = SCModel.SetObjectRights(id, "John", 3) 'give full rights