3 Replies Latest reply on Nov 16, 2017 3:49 PM by Bill Robinson

    Get User's roles with REST

    Dawid Rycerz

      I'm trying to gather via BBSA (8.9 SP1) REST API list of user's roles, but property ROLES* looks empty. Same situation trying get users that belongs to BSA role.

       

      Example query:

      https://localhost:9843/query?username=USER&password=PASSWORD&role=ROLE&BQUERY=SELECT NAME, ROLES* FROM "SystemObject/User" WHERE NAME equals "Test"

       

      Response (objects id hidden by me):

      {'PropertySetClassChildrenResponse': {'PropertySetClassChildren': {'Groups': {'Elements': [],

        'totalCount': '0'},

        'PropertySetClasses': {'Elements': [], 'totalCount': '0'},

        'PropertySetInstances': {'Elements': [{'PropertyValues': {'Elements': [{'name': 'NAME',

        'type': 'String',

        'uri': '/id/SystemObject/User/<id>/PropertyValues/NAME',

        'value': 'Test'},

        {'name': 'ROLES*',

        'type': '/type/PropertySetClasses/SystemObject/Role',

        'uri': '/id/SystemObject/User/<id>/PropertyValues/ROLES*/',

        'value': ''}],

        'totalCount': '2'},

        'dbKey': 'DBKey:SBLUserModelKeyImpl:<id>',

        'description': 'Testxxx',

        'modelType': 'BL_USER',

        'modelTypeId': '1007',

        'name': 'Test',

        'objectId': '<id>',

        'type': '/type/PropertySetClasses/SystemObject/User',

        'uri': '/id/SystemObject/User/<id>'}],

        'totalCount': '1'}}}}

       

      Screen from BSA Console - 3 roles should be there.

       

      Same result while trying /id/SystemObject/User/<id>...

       

      Am I doing this wrong way? Is there possibility to get this information using REST?