mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 06:45:28 +00:00
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { Schema, model, Types, Document } from 'mongoose';
|
|
|
|
export interface IServiceAccountWorkspacePermission extends Document {
|
|
_id: Types.ObjectId;
|
|
serviceAccount: Types.ObjectId;
|
|
workspace: Types.ObjectId;
|
|
environment: string;
|
|
read: boolean;
|
|
write: boolean;
|
|
}
|
|
|
|
const serviceAccountWorkspacePermissionSchema = new Schema<IServiceAccountWorkspacePermission>(
|
|
{
|
|
serviceAccount: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: 'ServiceAccount',
|
|
required: true
|
|
},
|
|
workspace:{
|
|
type: Schema.Types.ObjectId,
|
|
ref: 'Workspace',
|
|
required: true
|
|
},
|
|
environment: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
read: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
write: {
|
|
type: Boolean,
|
|
default: false
|
|
}
|
|
},
|
|
{
|
|
timestamps: true
|
|
}
|
|
);
|
|
|
|
const ServiceAccountWorkspacePermission = model<IServiceAccountWorkspacePermission>('ServiceAccountWorkspacePermission', serviceAccountWorkspacePermissionSchema);
|
|
|
|
export default ServiceAccountWorkspacePermission; |