Click or drag to resize

IRoleIsRelationshipCovered Method

Returns true if the role defines rights for the given type of relationship. The relationships vary according to role type.

Namespace:  SuperOffice.COM.SuperOfficeDB
Assembly:  SuperOfficeDB.Interop (in SuperOfficeDB.Interop.dll) Version: 8.0.0.0
Syntax
bool IsRelationshipCovered(
	EnRelationshipToOwner relationToOwner
)

Parameters

relationToOwner
Type: SuperOffice.COM.SuperOfficeDBEnRelationshipToOwner

Return Value

Type: Boolean
Examples

[New Example]

This text may be copied to the notepad, and saved as a *.vbs file. Remember to change the login information.

This will test if role with id 3 has two spesific datarights.

VB
'This is written to run from a CRM SIX programfolder

enRoleTypeEmployee = 0
enRelToOtherGroup = 4
enRelToSameProject = 7

Dim db
Set db = CreateObject("superofficedb.Database")
If db.Login("<username>", "<password>") Then
    set roles = db.Admin.GetRoles(enRoleTypeEmployee)
     If roles.Count > 0 Then
    set role = roles.Item(3)        'User level 2
    End If    

    If role.IsRelationshipCovered(enRelToOtherGroup) Then
    MsgBox("RelToOtherGroup is true")
    End If
    If role.IsRelationshipCovered(enRelToSameProject) Then
    MsgBox("RelToSameProject is true")
    End If
Else
    MsgBox("failed to log in")
End If

See Also