Begin refactoring middleware for service accounts

This commit is contained in:
Tuan Dang
2023-04-04 11:08:03 +03:00
parent c797901778
commit aa53de9070
39 changed files with 943 additions and 577 deletions
@@ -5,10 +5,8 @@ export interface IServiceAccountWorkspacePermission extends Document {
serviceAccount: Types.ObjectId;
workspace: Types.ObjectId;
environment: string;
canRead: boolean;
canWrite: boolean;
canUpdate: boolean;
canDelete: boolean;
read: boolean;
write: boolean;
}
const serviceAccountWorkspacePermissionSchema = new Schema<IServiceAccountWorkspacePermission>(
@@ -27,19 +25,11 @@ const serviceAccountWorkspacePermissionSchema = new Schema<IServiceAccountWorksp
type: String,
required: true
},
canRead: {
read: {
type: Boolean,
default: false
},
canWrite: {
type: Boolean,
default: false
},
canUpdate: {
type: Boolean,
default: false
},
canDelete: {
write: {
type: Boolean,
default: false
}
+3 -2
View File
@@ -1,6 +1,7 @@
import { Schema, model, Types } from 'mongoose';
import { Schema, model, Types, Document } from 'mongoose';
export interface IServiceTokenData {
export interface IServiceTokenData extends Document {
_id: Types.ObjectId;
name: string;
workspace: Types.ObjectId;
environment: string;