mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +00:00
EC-263 - Deactivate/activate in user management (#2893)
* SM-48 - Disable/enable in user management * SM-48 - Disabled badge added to edit user * SM-48 - Fix linter issues * SM-48 - Color adjustments to badging * SM-48 - Fix prettier formatting * EC-263 - Rename disable to deactivate * EC-263 - lint errors and cleanup * EC-263 - Fix build and importer errors * EC-263 - import grouping order fix * EC-263 - PR review feedback and cleanup * EC-263 - Fix build error in loose components * EC-263 - Fix build error on formPromise in user edit * EC-263 - Fix a11y bindings and modal handling
This commit is contained in:
@@ -444,6 +444,16 @@ export abstract class ApiService {
|
||||
organizationId: string,
|
||||
request: OrganizationUserBulkRequest
|
||||
) => Promise<ListResponse<OrganizationUserBulkResponse>>;
|
||||
deactivateOrganizationUser: (organizationId: string, id: string) => Promise<any>;
|
||||
deactivateManyOrganizationUsers: (
|
||||
organizationId: string,
|
||||
request: OrganizationUserBulkRequest
|
||||
) => Promise<ListResponse<OrganizationUserBulkResponse>>;
|
||||
activateOrganizationUser: (organizationId: string, id: string) => Promise<any>;
|
||||
activateManyOrganizationUsers: (
|
||||
organizationId: string,
|
||||
request: OrganizationUserBulkRequest
|
||||
) => Promise<ListResponse<OrganizationUserBulkResponse>>;
|
||||
|
||||
getSync: () => Promise<SyncResponse>;
|
||||
postImportDirectory: (organizationId: string, request: ImportDirectoryRequest) => Promise<any>;
|
||||
|
||||
@@ -2,4 +2,5 @@ export enum OrganizationUserStatusType {
|
||||
Invited = 0,
|
||||
Accepted = 1,
|
||||
Confirmed = 2,
|
||||
Deactivated = -1,
|
||||
}
|
||||
|
||||
@@ -2,4 +2,5 @@ export enum ProviderUserStatusType {
|
||||
Invited = 0,
|
||||
Accepted = 1,
|
||||
Confirmed = 2,
|
||||
Deactivated = -1, // Not used, compile-time support only
|
||||
}
|
||||
|
||||
@@ -1361,6 +1361,54 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
return new ListResponse(r, OrganizationUserBulkResponse);
|
||||
}
|
||||
|
||||
deactivateOrganizationUser(organizationId: string, id: string): Promise<any> {
|
||||
return this.send(
|
||||
"PUT",
|
||||
"/organizations/" + organizationId + "/users/" + id + "/deactivate",
|
||||
null,
|
||||
true,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
async deactivateManyOrganizationUsers(
|
||||
organizationId: string,
|
||||
request: OrganizationUserBulkRequest
|
||||
): Promise<ListResponse<OrganizationUserBulkResponse>> {
|
||||
const r = await this.send(
|
||||
"PUT",
|
||||
"/organizations/" + organizationId + "/users/deactivate",
|
||||
request,
|
||||
true,
|
||||
true
|
||||
);
|
||||
return new ListResponse(r, OrganizationUserBulkResponse);
|
||||
}
|
||||
|
||||
activateOrganizationUser(organizationId: string, id: string): Promise<any> {
|
||||
return this.send(
|
||||
"PUT",
|
||||
"/organizations/" + organizationId + "/users/" + id + "/activate",
|
||||
null,
|
||||
true,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
async activateManyOrganizationUsers(
|
||||
organizationId: string,
|
||||
request: OrganizationUserBulkRequest
|
||||
): Promise<ListResponse<OrganizationUserBulkResponse>> {
|
||||
const r = await this.send(
|
||||
"PUT",
|
||||
"/organizations/" + organizationId + "/users/activate",
|
||||
request,
|
||||
true,
|
||||
true
|
||||
);
|
||||
return new ListResponse(r, OrganizationUserBulkResponse);
|
||||
}
|
||||
|
||||
// Plan APIs
|
||||
|
||||
async getPlans(): Promise<ListResponse<PlanResponse>> {
|
||||
|
||||
Reference in New Issue
Block a user