Cumulocity Web SDK - v1021.62.8
    Preparing search index...

    Class UserRoleService

    This service allows for fetch user roles.

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Gets the details of given role.

      Parameters

      • entityOrId: string | number | IRole

        Roles's id or role object.

      Returns Promise<IResult<IRole>>

      Returns promise object that is resolved with the IRole wrapped by IResult.

      Example


      const roleId: number = 1;

      (async () => {
      const {data, res} = await userRoleService.detail(roleId);
      })();
    • Gets the list of user roles filtered by parameters.

      Parameters

      • filter: object = {}

        Object containing filters for querying roles.

      Returns Promise<IResultList<IRole>>

      Returns promise object that is resolved with the IRole wrapped by IResultList.

      Example


      const filter: object = {
      severity: Severity.MAJOR,
      pageSize: 100,
      withTotalPages: true
      };

      (async () => {
      const {data, res, paging} = await userRoleService.list(filter);
      })();