Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Deck of Cards
idbimCreateNewRole
Card
defaulttrue
labelURL / Resource / JSON Structure
Resource: <team_slug>/roles 

URLhttps://api-stage.bimplus.net/v2/<team_slug>/roles

Examplehttps://api-stage.bimplus.net/v2/bimplus/roles


JSON Structure

Name

Mandatory / Optional

Type

Description

id

optional

string (guid)

Id of the role

name

mandatory

string

The name of the role

parent

optional

string (guid)

The Id of the parent role

customRole

mandatory

boolean

When this flag is true the role is custom role otherwise will role is 'built in' role

resources

mandatory

JSON Array

Array of the resource definition objects for which the role is valid


JSON Structure of the resource definition object

Name

Mandatory / Optional

Type

Description

resource

mandatory

string

Describe kind of right e.g. "UserRightGlobal" or "UserRightLayer"

rights

mandatory

JSON Array

Array of the strings of rights e.g.: "FreeAttributeView", "MEP: 2", "MEPEdit"

Card
labelHTTP Method
 POST
Card
labelDescription
 Creates a new role with defined properties and resources to be valid for.
Card
labelRequest
Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
Code Block
borderColorRed
langxml
titleJSON
{
    "parent": "213becc0-ad48-4cd0-aef2-b922b21bbfd7",
    "name": "TestRole",
    "customRole": true,
    "resources": [
        {
            "resource": "UserRightGlobal",
            "rights": [
                "FreeAttributeView",
                "FreeAttributeGroupView",
                "AttributeTemplateView",
                "ProjectAttributeTemplateView"
            ]
        },
        {
            "resource": "UserRightLayer",
            "rights": [
                "MEP: 2"
            ]
        }
    ]
}
Card
labelResponse
Code Block
borderColorGreen
langxml
titleStatus
Status: 201 Created
Code Block
borderColorRed
langxml
titleJSON
{
    "id": "118898b6-0b86-4876-bb05-bf5294e392d6",
    "parent": "213becc0-ad48-4cd0-aef2-b922b21bbfd7",
    "name": "TestRole",
    "customRole": true,
    "resources": [
        {
            "resource": "UserRightGlobal",
            "rights": [
                "FreeAttributeView",
                "FreeAttributeGroupView",
                "AttributeTemplateView",
                "ProjectAttributeTemplateView"
            ]
        },
        {
            "resource": "UserRightLayer",
            "rights": [
                "MEPEdit"
            ]
        }
    ]
}

...