diff --git a/service/src/models/role.d.ts b/service/src/models/role.d.ts index f6784fa6a..b5f6a4bf7 100644 --- a/service/src/models/role.d.ts +++ b/service/src/models/role.d.ts @@ -1,20 +1,22 @@ - +import mongoose from 'mongoose' import { AnyPermission } from '../entities/authorization/entities.permissions' type Callback = (err: any, result?: R) => any export declare interface RoleDocument { - id: string + _id: mongoose.Types.ObjectId name: string description?: string permissions: AnyPermission[] } +export type RoleModelInstance = mongoose.HydratedDocument + export declare type RoleJson = Omit -export declare function getRoleById(id: string, callback: Callback): void -export declare function getRole(name: string, callback: Callback): void -export declare function getRoles(callback: Callback): void -export declare function createRole(role: RoleDocument, callback: Callback): void -export declare function updateRole(id: string, update: Partial, callback: Callback): void -export declare function deleteRole(role: RoleDocument, callback: Callback): void +export declare function getRoleById(id: string, callback: Callback): void +export declare function getRole(name: string, callback: Callback): void +export declare function getRoles(callback: Callback): void +export declare function createRole(role: Omit, callback: Callback): void +export declare function updateRole(id: string, update: Partial, callback: Callback): void +export declare function deleteRole(role: RoleModelInstance, callback: Callback): void