Skip to content

Commit

Permalink
add missing types for privileges (#4332)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek committed Sep 27, 2023
1 parent 911806b commit 1dfd2c9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/core/superdesk-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1297,12 +1297,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;
}
Expand Down Expand Up @@ -1378,7 +1380,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;
Expand Down Expand Up @@ -2843,6 +2845,7 @@ declare module 'superdesk-api' {
): string;
};
privileges: {
getOwnPrivileges(): Promise<IUserPrivileges>;
hasPrivilege(privilege: string): boolean;
};
preferences: {
Expand Down

0 comments on commit 1dfd2c9

Please sign in to comment.