mirror of
https://github.com/immich-app/immich.git
synced 2026-02-11 11:27:56 +03:00
add set permission endpoint and UI
This commit is contained in:
@@ -589,6 +589,59 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"/album/{id}/permission/{userId}": {
|
||||
"put": {
|
||||
"operationId": "setAlbumPermission",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "id",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"format": "uuid",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "userId",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/SetAlbumPermissionDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
},
|
||||
{
|
||||
"cookie": []
|
||||
},
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Album"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/album/{id}/user/{userId}": {
|
||||
"delete": {
|
||||
"operationId": "removeUserFromAlbum",
|
||||
@@ -9914,6 +9967,17 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"SetAlbumPermissionDto": {
|
||||
"properties": {
|
||||
"readonly": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"readonly"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"SharedLinkCreateDto": {
|
||||
"properties": {
|
||||
"albumId": {
|
||||
|
||||
@@ -193,6 +193,9 @@ export type BulkIdResponseDto = {
|
||||
id: string;
|
||||
success: boolean;
|
||||
};
|
||||
export type SetAlbumPermissionDto = {
|
||||
"readonly": boolean;
|
||||
};
|
||||
export type AddUsersDto = {
|
||||
sharedUserIds: string[];
|
||||
};
|
||||
@@ -1193,6 +1196,17 @@ export function addAssetsToAlbum({ id, key, bulkIdsDto }: {
|
||||
body: bulkIdsDto
|
||||
})));
|
||||
}
|
||||
export function setAlbumPermission({ id, userId, setAlbumPermissionDto }: {
|
||||
id: string;
|
||||
userId: string;
|
||||
setAlbumPermissionDto: SetAlbumPermissionDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchText(`/album/${encodeURIComponent(id)}/permission/${encodeURIComponent(userId)}`, oazapfts.json({
|
||||
...opts,
|
||||
method: "PUT",
|
||||
body: setAlbumPermissionDto
|
||||
})));
|
||||
}
|
||||
export function removeUserFromAlbum({ id, userId }: {
|
||||
id: string;
|
||||
userId: string;
|
||||
|
||||
Reference in New Issue
Block a user