mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): narrow auth types (#16066)
This commit is contained in:
parent
7c821dd205
commit
2d7c333c8c
25 changed files with 265 additions and 239 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { BadRequestException, UnauthorizedException } from '@nestjs/common';
|
||||
import { AuthSharedLink } from 'src/database';
|
||||
import { AuthDto } from 'src/dtos/auth.dto';
|
||||
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
|
||||
import { AlbumUserRole, Permission } from 'src/enum';
|
||||
import { AccessRepository } from 'src/repositories/access.repository';
|
||||
import { setDifference, setIsEqual, setIsSuperset, setUnion } from 'src/utils/set';
|
||||
|
|
@ -24,7 +24,7 @@ export type AccessRequest = {
|
|||
ids: Set<string> | string[];
|
||||
};
|
||||
|
||||
type SharedLinkAccessRequest = { sharedLink: SharedLinkEntity; permission: Permission; ids: Set<string> };
|
||||
type SharedLinkAccessRequest = { sharedLink: AuthSharedLink; permission: Permission; ids: Set<string> };
|
||||
type OtherAccessRequest = { auth: AuthDto; permission: Permission; ids: Set<string> };
|
||||
|
||||
export const requireUploadAccess = (auth: AuthDto | null): AuthDto => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue