Versions Compared

Key

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

...

Deck of Cards
idbimGetAllRoles
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/best-company/roles

Card
labelHTTP Method
 GET

Optional query parameters

NameTypeDefault valueDescription
rightsbooleantrue

When query parameter "rights=false" is defined, the API call will returns all roles. i.e. not only roles which contains
resources and right definitions.
When query parameter is missing, the API call returns only roles which includes resources and rights definitions.


Card
labelHTTP Method
 GET
Card
labelDescription

 Get all the available roles. Right now, we support only project based roles and custom roles.

Here is the

Card
labelDescription

 Get all the available. Right now, we support only project based roles.

Here is the definition of Bimplus Rights & Roles.


Account OwnerProject AdminProject EditorProject Viewer
Create projectx


Admin projectxx

Delete projectxx

Edit projectxxx
View projectxxxx
Create modelxx

View all modelsxxxx

Model rights and roles are not supported yet, the project rights are used instead - meaning e.g. update model requires ProjectEdit rights


The custom roles contains also definition for which resource and rights are valid.


Card
labelRequest
Code Block
Card
labelRequest
Code Block
borderColorGreen
langxml
titleHeaders
Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
Content-Type: application/json
Card
labelResponse
Code Block
borderColorGreen
langxml
titleStatus
Status: 200 Ok
Code Block
borderColorRed
langxml
titleJSON
[[
    {
        "id": "f11d32e2-30b7-4f81-8a74-2165ecc00cf6",
        "name": "Project_Editor",
        "customRole": false,
        "resources": [
            {
                "resource": "UserRightProject",
                "rights": [
                    "Project_Edit",
                    "Project_View",
                    "Model_ViewAll"
                ]
            }
        ]
    },
    {
        "id": "2baca0e4f11d32e2-2eee30b7-4f7c4f81-bc568a74-22ed54a1859c2165ecc00cf6",
        "name": "AccountProject_OwnerEditor",
        "customRole": falsetrue,
        "resources": [{
        "resource":"UserRightProject",
    {
       "rights":["ProjectEdit",
         "resource": "UserRightGlobalModel_ViewAll",
                "rights": ["Model_Create"
        ]
      }
    ]
  "AllProjects"},
  {
    "id":"213becc0-ad48-4cd0-aef2-b922b21bbfd7",
          "name":"TestRoleParent",
    "AllModelscustomRole":true,
    "resources":[{
        "resource":"UserRightLayer",
        "Project_Create"rights":["MEPEdit"
        ]
        ]}
    ],
        }"children":[{
        ]
    },
 "id":"d1310d52-addf-4264-8623-29730d2cc775",
   {
        "idparent": "a298b28d213becc0-9711ad48-4a764cd0-9a7daef2-910cbf144ee5b922b21bbfd7",
        "name": "Project_AdminTestchild",
        "customRole": falsetrue,
        "resources": [{
            {
    "resource":"UserRightGlobalFreeAttributes",
            "resourcerights": ["UserRightProjectFreeAttributeView",
              "FreeAttributeGroupView",
      "rights": [
       "AttributeTemplateView",
              "Project_AdminProjectAttributeTemplateView",
            ]
        "Project_Edit"  },
          {
            "Project_Delete"resource":"UserRightLayer",
                    "Project_View",
"rights":["MEPEdit"
            ]
          "Model_ViewAll",}
        ]
      },
      "Model_Create"{
        "id":"118898b6-0b86-4876-bb05-bf5294e392d6",
        ]
"parent":"213becc0-ad48-4cd0-aef2-b922b21bbfd7",
        "name":"TestRole",
      }
  "customRole":true,
      ]
    },"resources":[{
    {
        "idresource": "a618d075-7e4a-4bde-9d58-d2979696fa96"UserRightGlobalFreeAttributes",
            "namerights": ["Project_ViewerFreeAttributeView",
              "customRoleFreeAttributeGroupView": false,
        "resources": [
        "AttributeTemplateView",
    {
          "ProjectAttributeTemplateView"
      "resource": "UserRightProject",
     ]
           "rights": [
},
          {
            "Project_View"resource":"UserRightLayer",
            "rights":["MEPEdit"
        "Model_ViewAll"
    ]
          }
  ]
      ]
      }
        ]
    }
]


Anchor
createNewRole
createNewRole

...

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"
            ]
        }
    ]
}

...