refactor: domain repositories (#4403)

This commit is contained in:
Jason Rasmussen
2023-10-09 10:25:03 -04:00
committed by GitHub
parent b56f22aac3
commit 2ea080cacd
93 changed files with 313 additions and 227 deletions

View File

@@ -1,6 +1,6 @@
import { BadRequestException, UnauthorizedException } from '@nestjs/common';
import { AuthUserDto } from '../auth';
import { IAccessRepository } from './access.repository';
import { IAccessRepository } from '../repositories';
export enum Permission {
// ASSET_CREATE = 'asset.create',

View File

@@ -1,29 +0,0 @@
export const IAccessRepository = 'IAccessRepository';
export interface IAccessRepository {
asset: {
hasOwnerAccess(userId: string, assetId: string): Promise<boolean>;
hasAlbumAccess(userId: string, assetId: string): Promise<boolean>;
hasPartnerAccess(userId: string, assetId: string): Promise<boolean>;
hasSharedLinkAccess(sharedLinkId: string, assetId: string): Promise<boolean>;
};
album: {
hasOwnerAccess(userId: string, albumId: string): Promise<boolean>;
hasSharedAlbumAccess(userId: string, albumId: string): Promise<boolean>;
hasSharedLinkAccess(sharedLinkId: string, albumId: string): Promise<boolean>;
};
library: {
hasOwnerAccess(userId: string, libraryId: string): Promise<boolean>;
hasPartnerAccess(userId: string, partnerId: string): Promise<boolean>;
};
timeline: {
hasPartnerAccess(userId: string, partnerId: string): Promise<boolean>;
};
person: {
hasOwnerAccess(userId: string, personId: string): Promise<boolean>;
};
}

View File

@@ -1,2 +1 @@
export * from './access.core';
export * from './access.repository';