mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
refactor(server): access permissions (#2910)
* refactor: access repo interface * feat: access core * fix: allow shared links to add to a shared link * chore: comment out unused code * fix: pr feedback --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -1,14 +1,28 @@
|
||||
import { IAccessRepository } from '@app/domain';
|
||||
|
||||
export const newAccessRepositoryMock = (): jest.Mocked<IAccessRepository> => {
|
||||
export type IAccessRepositoryMock = {
|
||||
asset: jest.Mocked<IAccessRepository['asset']>;
|
||||
album: jest.Mocked<IAccessRepository['album']>;
|
||||
library: jest.Mocked<IAccessRepository['library']>;
|
||||
};
|
||||
|
||||
export const newAccessRepositoryMock = (): IAccessRepositoryMock => {
|
||||
return {
|
||||
hasPartnerAccess: jest.fn(),
|
||||
asset: {
|
||||
hasOwnerAccess: jest.fn(),
|
||||
hasAlbumAccess: jest.fn(),
|
||||
hasPartnerAccess: jest.fn(),
|
||||
hasSharedLinkAccess: jest.fn(),
|
||||
},
|
||||
|
||||
hasAlbumAssetAccess: jest.fn(),
|
||||
hasOwnerAssetAccess: jest.fn(),
|
||||
hasPartnerAssetAccess: jest.fn(),
|
||||
hasSharedLinkAssetAccess: jest.fn(),
|
||||
album: {
|
||||
hasOwnerAccess: jest.fn(),
|
||||
hasSharedAlbumAccess: jest.fn(),
|
||||
hasSharedLinkAccess: jest.fn(),
|
||||
},
|
||||
|
||||
hasAlbumOwnerAccess: jest.fn(),
|
||||
library: {
|
||||
hasPartnerAccess: jest.fn(),
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user