mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
Assign ownership to many libs files (#6928)
Assign ownership to many of the remaining libs/common files. Criteria for ownership: * Files used by a single team, is now owned by that team. * Files related to a domain owned by a team is now owned by that team. * Where ownership is unclear the "lowest level" service takes ownership.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { KdfType } from "../../../../enums";
|
||||
import { BaseResponse } from "../../../../models/response/base.response";
|
||||
import { KdfType } from "../../../../platform/enums";
|
||||
import { OrganizationUserStatusType, OrganizationUserType } from "../../../enums";
|
||||
import { PermissionsApi } from "../../../models/api/permissions.api";
|
||||
import { SelectionReadOnlyResponse } from "../../../models/response/selection-read-only.response";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Provider } from "../../models/domain/provider";
|
||||
import { ProviderData } from "../models/data/provider.data";
|
||||
import { Provider } from "../models/domain/provider";
|
||||
|
||||
export abstract class ProviderService {
|
||||
get: (id: string) => Promise<Provider>;
|
||||
|
||||
@@ -3,6 +3,7 @@ export * from "./organization-connection-type.enum";
|
||||
export * from "./organization-user-status-type.enum";
|
||||
export * from "./organization-user-type.enum";
|
||||
export * from "./policy-type.enum";
|
||||
export * from "./provider-type.enum";
|
||||
export * from "./provider-user-status-type.enum";
|
||||
export * from "./provider-user-type.enum";
|
||||
export * from "./scim-provider-type.enum";
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export enum ProviderType {
|
||||
Msp = 0,
|
||||
Reseller = 1,
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ProductType, ProviderType } from "../../../enums";
|
||||
import { OrganizationUserStatusType, OrganizationUserType } from "../../enums";
|
||||
import { ProductType } from "../../../enums";
|
||||
import { OrganizationUserStatusType, OrganizationUserType, ProviderType } from "../../enums";
|
||||
import { PermissionsApi } from "../api/permissions.api";
|
||||
import { ProfileOrganizationResponse } from "../response/profile-organization.response";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Jsonify } from "type-fest";
|
||||
|
||||
import { ProductType, ProviderType } from "../../../enums";
|
||||
import { OrganizationUserStatusType, OrganizationUserType } from "../../enums";
|
||||
import { ProductType } from "../../../enums";
|
||||
import { OrganizationUserStatusType, OrganizationUserType, ProviderType } from "../../enums";
|
||||
import { PermissionsApi } from "../api/permissions.api";
|
||||
import { OrganizationData } from "../data/organization.data";
|
||||
|
||||
|
||||
49
libs/common/src/admin-console/models/domain/provider.ts
Normal file
49
libs/common/src/admin-console/models/domain/provider.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { ProviderUserStatusType, ProviderUserType } from "../../enums";
|
||||
import { ProviderData } from "../data/provider.data";
|
||||
|
||||
export class Provider {
|
||||
id: string;
|
||||
name: string;
|
||||
status: ProviderUserStatusType;
|
||||
type: ProviderUserType;
|
||||
enabled: boolean;
|
||||
userId: string;
|
||||
useEvents: boolean;
|
||||
|
||||
constructor(obj?: ProviderData) {
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.id = obj.id;
|
||||
this.name = obj.name;
|
||||
this.status = obj.status;
|
||||
this.type = obj.type;
|
||||
this.enabled = obj.enabled;
|
||||
this.userId = obj.userId;
|
||||
this.useEvents = obj.useEvents;
|
||||
}
|
||||
|
||||
get canAccess() {
|
||||
if (this.isProviderAdmin) {
|
||||
return true;
|
||||
}
|
||||
return this.enabled && this.status === ProviderUserStatusType.Confirmed;
|
||||
}
|
||||
|
||||
get canCreateOrganizations() {
|
||||
return this.enabled && this.isProviderAdmin;
|
||||
}
|
||||
|
||||
get canManageUsers() {
|
||||
return this.isProviderAdmin;
|
||||
}
|
||||
|
||||
get canAccessEventLogs() {
|
||||
return this.isProviderAdmin;
|
||||
}
|
||||
|
||||
get isProviderAdmin() {
|
||||
return this.type === ProviderUserType.ProviderAdmin;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ProductType, ProviderType } from "../../../enums";
|
||||
import { ProductType } from "../../../enums";
|
||||
import { BaseResponse } from "../../../models/response/base.response";
|
||||
import { OrganizationUserStatusType, OrganizationUserType } from "../../enums";
|
||||
import { OrganizationUserStatusType, OrganizationUserType, ProviderType } from "../../enums";
|
||||
import { PermissionsApi } from "../api/permissions.api";
|
||||
|
||||
export class ProfileOrganizationResponse extends BaseResponse {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Provider } from "../../models/domain/provider";
|
||||
import { StateService } from "../../platform/abstractions/state.service";
|
||||
import { ProviderService as ProviderServiceAbstraction } from "../abstractions/provider.service";
|
||||
import { ProviderData } from "../models/data/provider.data";
|
||||
import { Provider } from "../models/domain/provider";
|
||||
|
||||
export class ProviderService implements ProviderServiceAbstraction {
|
||||
constructor(private stateService: StateService) {}
|
||||
|
||||
Reference in New Issue
Block a user