From 021e86b3eb041821b00d83d8ceac2b466d88f500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Ja=C5=A1ek?= Date: Wed, 27 Sep 2023 16:02:57 +0200 Subject: [PATCH] add missing types for privileges (#4332) --- scripts/core/superdesk-api.d.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/core/superdesk-api.d.ts b/scripts/core/superdesk-api.d.ts index 3c02189f74..f501bf0f92 100644 --- a/scripts/core/superdesk-api.d.ts +++ b/scripts/core/superdesk-api.d.ts @@ -597,12 +597,14 @@ declare module 'superdesk-api' { archive_item: IArticle; } + export interface IUserPrivileges { + [privilege: string]: 1 | 0; + } + export interface IUserRole extends IBaseRestApiResponse { _id: string; name: string; - privileges?: { - [privilege: string]: 1 | 0; - }; + privileges?: IUserPrivileges; author_role: string; editor_role: string; } @@ -677,7 +679,7 @@ declare module 'superdesk-api' { avatar: string; avatar_renditions: {}; role?: IUserRole['_id']; - privileges: {}; + privileges: IUserPrivileges; user_type: 'user' | 'administrator'; is_support: boolean; is_author: boolean; @@ -1846,7 +1848,7 @@ declare module 'superdesk-api' { ): string; }; privileges: { - getOwnPrivileges(): Promise; + getOwnPrivileges(): Promise; hasPrivilege(privilege: string): boolean; }; preferences: {