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 authored Sep 27, 2023
1 parent d088323 commit 021e86b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/core/superdesk-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1846,7 +1848,7 @@ declare module 'superdesk-api' {
): string;
};
privileges: {
getOwnPrivileges(): Promise<any>;
getOwnPrivileges(): Promise<IUserPrivileges>;
hasPrivilege(privilege: string): boolean;
};
preferences: {
Expand Down

0 comments on commit 021e86b

Please sign in to comment.