You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »


Rights & Roles Service


Rights & Roles Service


Get all the available roles
    Resource: <team_slug>/roles 

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

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

    Optional query parameters

    Name Type Default value Description
    rights boolean true

    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.


     GET

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

    Here is the definition of Bimplus Rights & Roles.


    Account Owner Project Admin Project Editor Project Viewer
    Create project x


    Admin project x x

    Delete project x x

    Edit project x x x
    View project x x x x
    Create model x x

    View all models x x x x

    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.


    Headers
    Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
    Content-Type: application/json
    
    Status
    Status: 200 Ok
    
    JSON
    [{
        "id":"f11d32e2-30b7-4f81-8a74-2165ecc00cf6",
        "name":"Project_Editor",
        "customRole":true,
        "resources":[{
            "resource":"UserRightProject",
            "rights":["ProjectEdit",
              "Model_ViewAll",
              "Model_Create"
            ]
          }
        ]
      },
      {
        "id":"213becc0-ad48-4cd0-aef2-b922b21bbfd7",
        "name":"TestRoleParent",
        "customRole":true,
        "resources":[{
            "resource":"UserRightLayer",
            "rights":["MEPEdit"
            ]
          }
        ],
        "children":[{
            "id":"d1310d52-addf-4264-8623-29730d2cc775",
            "parent":"213becc0-ad48-4cd0-aef2-b922b21bbfd7",
            "name":"Testchild",
            "customRole":true,
            "resources":[{
                "resource":"UserRightGlobalFreeAttributes",
                "rights":["FreeAttributeView",
                  "FreeAttributeGroupView",
                  "AttributeTemplateView",
                  "ProjectAttributeTemplateView"
                ]
              },
              {
                "resource":"UserRightLayer",
                "rights":["MEPEdit"
                ]
              }
            ]
          },
          {
            "id":"118898b6-0b86-4876-bb05-bf5294e392d6",
            "parent":"213becc0-ad48-4cd0-aef2-b922b21bbfd7",
            "name":"TestRole",
            "customRole":true,
            "resources":[{
                "resource":"UserRightGlobalFreeAttributes",
                "rights":["FreeAttributeView",
                  "FreeAttributeGroupView",
                  "AttributeTemplateView",
                  "ProjectAttributeTemplateView"
                ]
              },
              {
                "resource":"UserRightLayer",
                "rights":["MEPEdit"
                ]
              }
            ]
          }
        ]
      }
    ]


    Create a new role
      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"

       POST
       Creates a new role with defined properties and resources to be valid for.
      Headers
      Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
      Content-Type: application/json
      
      JSON
      {
          "parent": "213becc0-ad48-4cd0-aef2-b922b21bbfd7",
          "name": "TestRole",
          "customRole": true,
          "resources": [
              {
                  "resource": "UserRightGlobal",
                  "rights": [
                      "FreeAttributeView",
                      "FreeAttributeGroupView",
                      "AttributeTemplateView",
                      "ProjectAttributeTemplateView"
                  ]
              },
              {
                  "resource": "UserRightLayer",
                  "rights": [
                      "MEP: 2"
                  ]
              }
          ]
      }
      Status
      Status: 201 Created
      
      JSON
      {
          "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"
                  ]
              }
          ]
      }


      Get details of the role

        Resource: <team_slug>/roles/<role_id>

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

        Examplehttps://api-stage.bimplus.net/v2/bimplus/roles/213becc0-ad48-4cd0-aef2-b922b21bbfd7


        Optional query parameters

        Name Type Default value Description
        groups boolean false

        When query parameter "groups=true" is defined, the API function returns all only group names to which is cross section definition assigned.


         GET
         Get details of a specified role.
        Headers
        Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
        Content-Type: application/json
        
        Status
        Status: 200 OK
        
        JSON
         {
            "id": "118898b6-0b86-4876-bb05-bf5294e392d6",
            "parent": "213becc0-ad48-4cd0-aef2-b922b21bbfd7",
            "name": "Skuska2child",
            "customRole": true,
            "resources": [
                {
                    "resource": "UserRightGlobalFreeAttributes",
                    "rights": [
                        "FreeAttributeView",
                        "FreeAttributeGroupView",
                        "AttributeTemplateView",
                        "ProjectAttributeTemplateView"
                    ]
                },
                {
                    "resource": "UserRightLayer",
                    "rights": [
                        "MEPEdit"
                    ]
                }
            ]
        }
        
        


        Update the role

          Resource: <team_slug>/roles/<role_id>

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

          Examplehttps://api-stage.bimplus.net/v2/bimplus/roles/213becc0-ad48-4cd0-aef2-b922b21bbfd7

          Json structure : See above in Create a new role section.


           PUT
          Update the role.
          Headers
          Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
          Content-Type: application/json
          
          JSON
          {
              "name": "Skuska2update",
              "customRole": true,
          
              "resources": 
          	[ 
                  {
                      "resource": "UserRightLayer",
                      "rights": 
          			[
                           "MEP: 3"
                           
                      ]
                  }
              ]
          }
          Status
          Status: 200 OK
          
          JSON
          {
          	"id": "213becc0-ad48-4cd0-aef2-b922b21bbfd7",
          	"name": "Skuska2update",
          	"customRole": true,
          	"resources": [
          		{
          			"resource": "UserRightLayer",
          			"rights": [
          				"MEPAdmin"
          			]
          		}
          	]
          }

          Delete the role

            Resource: <team_slug>/roles/<role_id>

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

            Examplehttps://api-stage.bimplus.net/v2/bimplus/roles/213becc0-ad48-4cd0-aef2-b922b21bbfd7

             DELETE
             Deletes a specified role.
            Headers
            Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
            Content-Type: application/json
            
            Status
            Status: 200 OK
            


            Make a team member part of a project by assigning a role to him
              Resource: projects/<project_id>/members 

              URLhttps://api-stage.bimplus.net/v2/<team_slug>/projects/<project_id>/members 

              Examplehttps://api-stage.bimplus.net/v2/bimplus/projects/b8615afc-99cc-4bcd-b0ca-ff0593ce15c6/members

              JSON Structure

              Name

              Mandatory / Optional

              Type

              Description

              member

              mandatory

              object

              The member who will be assigned a role to the project

              id

              mandatory

              string (guid)

              Id of the user

              role

              mandatory

              object

              The project role which will be assigned to the team member

              id

              mandatory

              string (guid)

              Id of the role

               POST
               Assign a project role to an existing member of a team. Only the user with "Account Owner" or "Project Owner" role can use this API call.
              Headers
              Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
              Content-Type: application/json
              
              JSON
              {
                "member": {
                  "id": "bf5b2382-1d14-b8df-8454-947f83b45c25"
                },
                role: {
                  id: "f11d32e2-30b7-4f81-8a74-2165ecc00cf6"
              }
              Status
              Status: 201 Created
              
              JSON
              {
                "member": {
                  "id": "bf5b2382-1d14-b8df-8454-947f83b45c25",
                  "email": "testuser@bimplus.net",
                  "firstname" : "Test",
                  "lastname" : "User",
                  ...
                },
                "role": {
                  "id": "f11d32e2-30b7-4f81-8a74-2165ecc00cf6",
                  "name": "Project_Editor"
              }

              Get the project members along with their respective roles

                Resource: projects/<project_id>/members 

                URLhttps://api-stage.bimplus.net/v2/<team_slug>/projects/<project_id>/members 

                Examplehttps://api-stage.bimplus.net/v2/bimplus/projects/b8615afc-99cc-4bcd-b0ca-ff0593ce15c6/members

                 GET
                 Get the member list of a project along with their respective project roles.
                Headers
                Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
                Content-Type: application/json
                
                Status
                Status: 200 OK
                
                JSON
                [
                  {
                    "member": {
                      "id": "bf5b2382-1d14-b8df-8454-947f83b45c25",
                      "email": "testuser@bimplus.net",
                      "firstname" : "Test",
                      "lastname" : "User",
                      ...
                    },
                    "role": {
                      "id": "f11d32e2-30b7-4f81-8a74-2165ecc00cf6",
                      "name": "Project_Editor"
                    },
                  {
                    "member": {
                      "id": "bf5b2382-1d14-b8df-8454-947f83b45c25",
                      "email": "customer2@bimplus.net"
                      "firstname" : "Some",
                      "lastname" : "Customer",
                      ...
                    },
                    "role": {
                      "id": "e11d32e2-30b7-4f81-8a74-2165ecc00cf6",
                      "name": "Project_Viewer"
                    }
                  }
                ]

                Update the project role of a team member
                  Resource: projects/<project_id>/members 

                  URLhttps://api-stage.bimplus.net/v2/<team_slug>/projects/<project_id>/members 

                  Examplehttps://api-stage.bimplus.net/v2/bimplus/projects/b8615afc-99cc-4bcd-b0ca-ff0593ce15c6/members

                  JSON Structure

                  Name

                  Mandatory / Optional

                  Type

                  Description

                  member

                  mandatory

                  object

                  The member who will be assigned a role to the project

                  id

                  mandatory

                  string (guid)

                  Id of the user

                  role

                  mandatory

                  object

                  The project role which will be assigned to the team member

                  id

                  mandatory

                  string (guid)

                  Id of the role

                   PUT
                   Update the project role of a team member. Only the user with "Account Owner" or "Project Owner" role can use this API call.
                  Headers
                  Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
                  Content-Type: application/json
                  
                  JSON
                  {
                    "member": {
                      "id": "bf5b2382-1d14-b8df-8454-947f83b45c25"
                    },
                    "role": {
                      "id": "f11d32e2-30b7-4f81-8a74-2165ecc00cf6"
                  }
                  Status
                  Status: 200 OK
                  
                  JSON
                  {
                    "member": {
                      "id": "bf5b2382-1d14-b8df-8454-947f83b45c25",
                      "email": "customer@bimplus.net",
                      "firstname" : "Some",
                      "lastname" : "Customer",
                      ...
                    },
                    "role": {
                      "id": "f11d32e2-30b7-4f81-8a74-2165ecc00cf6",
                      "name": "Project_Viewer"
                  }

                  Remove the user from the project   
                    Resource: projects/<project_id>/members 

                    URLhttps://api-stage.bimplus.net/v2/<team_slug>/projects/<project_id>/members 

                    Examplehttps://api-stage.bimplus.net/v2/bimplus/projects/b8615afc-99cc-4bcd-b0ca-ff0593ce15c6/members

                     DELETE
                     Remove the user from a project
                    Headers
                    Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
                    Content-Type: application/json
                    
                    Status
                    Status: 200 OK
                    
                    • No labels