/auth
Search
K
Comment on page

removeAssignedRole( )

SlashAuth allows developers to assign roles directly to a user at the app-level and the org-level. This function allows for a role assignment to be removed from a user. If the user has the role via token-gate, this function will be a no-op.

Usage

const { data } = await client.user.removeAssignedRole({
userID: 'user.1234',
role: 'Super Admin',
});
console.log('Removed User Level: ', data?.level.name);

Return Value

{
data?: {
type: UserRoleType;
level: {
name: string;
description?: string;
};
};
error: ErrorMessage | null;
headers: Object;
statusCode: number;
}

Configuration

userID

String that represents a user's ID.
const { data } = await client.user.removeAssignedRole({
userID: 'user.1234',
role: 'Super Admin',
});
console.log('Removed User Level: ', data?.level.name);

role

String that represents a role.
const { data } = await client.user.removeAssignedRole({
userID: 'user.1234',
role: 'Super Admin',
});
console.log('Removed User Level: ', data?.level.name);

organizationID (optional)

String that represents an organization's ID.
const { data } = await client.user.removeAssignedRole({
userID: 'user.1234',
organizationID: 'org.abc',
role: 'Super Admin',
});
console.log('Removed User Level: ', data?.level.name);

Input(s)

Input
Type
Description
userID
String
String that represents a users ID.
role
String
String that represents a role.
organizationID
String
String that represents an organizations ID.

Output(s)

Output
Type
name
String
description
String