Click or drag to resize

Role-Based Security

VB
    Set curUser = db.GetAssociate( db.GetCurrentAssocId )
    canRun = curUser.Role.HasFunctionRight( "allow-bulk-mailmerge" )

If you had user admin permission, then you can use the Admin object to edit or add new roles with one or more rights. C = create, R = Read, U = Update, D = Delete:

VB
    Set newRole = db.Admin.CreateRole( enRoleTypeEmployee, Nothing )
    newRole.Name = "My role"
    newRole.Description = "Read only role"
    Set bulkInterest = db.Admin.GetFunctionRight( "allow-bulk-interests" )
    Set adminSaint = db.Admin.GetFunctionRight( "admin-saint-regeneration" )
    newRole.AddFunctionRight( bulkInterest )
    newRole.AddFunctionRight( adminSaint )
    newRole.DataRight( enTableContact, enRelToOwner ) = "CRUD"
    newRole.DataRight( enTableContact, enRelToGroup ) = "CRU"
    newRole.DataRight( enTableContact, enRelToOtherGroup ) = "CR"
    newRole.DataRight( enTableContact, enRelToOther ) = "R"
    newRole.DataRight( enTableProject, enRelToOwner ) = "CRUD"
    newRole.DataRight( enTableProject, enRelToGroup ) = "CRU"
    newRole.DataRight( enTableProject, enRelToOtherGroup ) = "CRU"
    newRole.DataRight( enTableProject, enRelToOther ) = "CRU"
    newRole.Save

This API corresponds to the Role panel in the Admin client:

Admin Role panel

Up: Getting Started   Prev: Common Tasks   Next: Simplified Bookings And Invitations          Edit