Skip to content

Latest commit

 

History

History
398 lines (267 loc) · 11.3 KB

roles-management.md

File metadata and controls

398 lines (267 loc) · 11.3 KB

Roles Management

9 operation(s). Part of the API index.

Call these as client.<service>.<method>(...). <service> is the client field for this group — the README lists the field name for every service. These pages group operations the way the OpenAPI specification tags them, which is not always one field per page.


deleteContextRoleByUid

DELETE /identity/v2/manage/account/{uid}/rolecontext/{contextName}/role

Delete Role from Context

Deletes the specified Role from a Context.

This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration.

Example

public static void callDeleteContextRoleByUid(LoginRadiusClient client) {
  String uid = "<uid>"; //Required
  String contextName = "<contextName>"; //Required
  Boolean preventWebhook = true; //Optional
  RemoveRoleContextRoleModel removeRoleContextRoleModel = new RemoveRoleContextRoleModel().roles("<roles>"); //Optional

  try {
    var response = client.rolesManagement.deleteContextRoleByUid(uid, contextName, preventWebhook, removeRoleContextRoleModel);
    System.out.println(response);
  } catch (ApiException e) {
    LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e);
    System.err.println(lr.description());
  }
}

Parameters

Name In Type Required Description
uid path string yes UID of the User
contextName path string yes Name of the Role Context
prevent_webhook query boolean no When true, suppresses webhook events for this operation.

Request body

RemoveRoleContextRoleModel as application/json.

Returns

DeleteResponse


deleteRoleContextAdditionalPermissionsByUid

DELETE /identity/v2/manage/account/{uid}/rolecontext/{contextName}/additionalpermission

Delete Additional Permissions from Context

Removes specified additional Permissions from a Context.

This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration.

Example

public static void callDeleteRoleContextAdditionalPermissionsByUid(LoginRadiusClient client) {
  String uid = "<uid>"; //Required
  String contextName = "<contextName>"; //Required
  Boolean preventWebhook = true; //Optional
  RemoveRoleContextAdditionalPermissionsModel removeRoleContextAdditionalPermissionsModel = new RemoveRoleContextAdditionalPermissionsModel().additionalpermissions("<additionalpermissions>"); //Optional

  try {
    var response = client.rolesManagement.deleteRoleContextAdditionalPermissionsByUid(uid, contextName, preventWebhook, removeRoleContextAdditionalPermissionsModel);
    System.out.println(response);
  } catch (ApiException e) {
    LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e);
    System.err.println(lr.description());
  }
}

Parameters

Name In Type Required Description
uid path string yes UID of the User
contextName path string yes Name of the Role Context
prevent_webhook query boolean no When true, suppresses webhook events for this operation.

Request body

RemoveRoleContextAdditionalPermissionsModel as application/json.

Returns

DeleteResponse


deleteRoleContextByUid

DELETE /identity/v2/manage/account/{uid}/rolecontext/{contextName}

Delete Role Context

Deletes the specified Role Context.

This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration.

Example

public static void callDeleteRoleContextByUid(LoginRadiusClient client) {
  String contextName = "<contextName>"; //Required
  String uid = "<uid>"; //Required
  Boolean preventWebhook = true; //Optional

  try {
    var response = client.rolesManagement.deleteRoleContextByUid(contextName, uid, preventWebhook);
    System.out.println(response);
  } catch (ApiException e) {
    LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e);
    System.err.println(lr.description());
  }
}

Parameters

Name In Type Required Description
contextName path string yes Name of the Role Context
prevent_webhook query boolean no When true, suppresses webhook events for this operation.
uid path string yes UID of the User

Returns

DeleteResponse


deleteRolesByUid

DELETE /identity/v2/manage/account/{uid}/role

Unassign Roles by UID

Removes specified Roles from a User using the UID.

This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration.

Example

public static void callDeleteRolesByUid(LoginRadiusClient client) {
  String uid = "<uid>"; //Required
  Boolean preventWebhook = true; //Optional
  UserRolesModel userRolesModel = new UserRolesModel().roles("<roles>"); //Optional

  try {
    var response = client.rolesManagement.deleteRolesByUid(uid, preventWebhook, userRolesModel);
    System.out.println(response);
  } catch (ApiException e) {
    LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e);
    System.err.println(lr.description());
  }
}

Parameters

Name In Type Required Description
uid path string yes UID of the User
prevent_webhook query boolean no When true, suppresses webhook events for this operation.

Request body

UserRolesModel as application/json.

Returns

DeleteResponse


getRoleContextByContextName

GET /identity/v2/manage/account/roleContext/{contextName}

Retrieve Role Context

Retrieves the Role Context for a specified Role.

This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration.

Example

public static void callGetRoleContextByContextName(LoginRadiusClient client) {
  String contextName = "<contextName>"; //Required

  try {
    var response = client.rolesManagement.getRoleContextByContextName(contextName);
    System.out.println(response);
  } catch (ApiException e) {
    LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e);
    System.err.println(lr.description());
  }
}

Parameters

Name In Type Required Description
contextName path string yes Name of the Role Context

Returns

RoleContextProfileResponseModel


getRoleContextByUid

GET /identity/v2/manage/account/{uid}/rolecontext

Retrieve Context by UID

Retrieves User Roles for all Contexts using the UID.

This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration.

Example

public static void callGetRoleContextByUid(LoginRadiusClient client) {
  String uid = "<uid>"; //Required

  try {
    var response = client.rolesManagement.getRoleContextByUid(uid);
    System.out.println(response);
  } catch (ApiException e) {
    LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e);
    System.err.println(lr.description());
  }
}

Parameters

Name In Type Required Description
uid path string yes UID of the User

Returns

RoleContextResponseModal


getRolesByUid

GET /identity/v2/manage/account/{uid}/role

Retrieve Roles by UID

Retrieves Roles associated with a specified UID.

This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration.

Example

public static void callGetRolesByUid(LoginRadiusClient client) {
  String uid = "<uid>"; //Required

  try {
    var response = client.rolesManagement.getRolesByUid(uid);
    System.out.println(response);
  } catch (ApiException e) {
    LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e);
    System.err.println(lr.description());
  }
}

Parameters

Name In Type Required Description
uid path string yes UID of the User

Returns

UserRolesModel


saveRolesByUid

PUT /identity/v2/manage/account/{uid}/role

Assign Roles by UID

Updates and assigns Roles to a User using the UID.

This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration.

Example

public static void callSaveRolesByUid(LoginRadiusClient client) {
  String uid = "<uid>"; //Required
  Boolean preventWebhook = true; //Optional
  UserRolesModel userRolesModel = new UserRolesModel().roles("<roles>"); //Optional

  try {
    var response = client.rolesManagement.saveRolesByUid(uid, preventWebhook, userRolesModel);
    System.out.println(response);
  } catch (ApiException e) {
    LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e);
    System.err.println(lr.description());
  }
}

Parameters

Name In Type Required Description
uid path string yes UID of the User
prevent_webhook query boolean no When true, suppresses webhook events for this operation.

Request body

UserRolesModel as application/json.

Returns

UserRolesModel


upsertRoleContextByUid

PUT /identity/v2/manage/account/{uid}/rolecontext

Upsert Context by UID

Creates or updates a Context with a set of Roles using the UID.

This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration.

Example

public static void callUpsertRoleContextByUid(LoginRadiusClient client) {
  String uid = "<uid>"; //Required
  Boolean preventWebhook = true; //Optional
  Boolean xPreventWebhook = true; //Optional
  UpdateRoleContextBodyModel updateRoleContextBodyModel = new UpdateRoleContextBodyModel().rolecontext("<rolecontext>"); //Optional

  try {
    var response = client.rolesManagement.upsertRoleContextByUid(uid, preventWebhook, xPreventWebhook, updateRoleContextBodyModel);
    System.out.println(response);
  } catch (ApiException e) {
    LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e);
    System.err.println(lr.description());
  }
}

Parameters

Name In Type Required Description
uid path string yes UID of the User
prevent_webhook query boolean no When true, suppresses webhook events for this operation.
X-PreventWebhook header boolean no When true, suppresses webhook events for this operation.

Request body

UpdateRoleContextBodyModel as application/json.

Returns

RoleContextResponseModal