feat: role authorizations - WIP

This commit is contained in:
Philipinho
2024-03-08 23:55:42 +00:00
parent 3e174b3838
commit b42fe48e9b
15 changed files with 263 additions and 14 deletions

View File

@ -13,6 +13,12 @@ import { WorkspaceService } from '../workspace/services/workspace.service';
import { DataSource, EntityManager } from 'typeorm';
import { transactionWrapper } from '../../helpers/db.helper';
import { CreateWorkspaceDto } from '../workspace/dto/create-workspace.dto';
import { Workspace } from '../workspace/entities/workspace.entity';
export type UserWithWorkspace = {
user: User;
workspace: Workspace;
};
@Injectable()
export class UserService {
@ -59,7 +65,7 @@ export class UserService {
return user;
}
async getUserInstance(userId: string) {
async getUserInstance(userId: string): Promise<UserWithWorkspace> {
const user: User = await this.findById(userId);
if (!user) {