mirror of
https://github.com/strapi/strapi.git
synced 2025-07-23 00:51:17 +00:00

* chore(wip): convert settings pages * chore: add api-tokens contract * fix: types * chore: convert webhooks page (#18682) * chore: convert webhooks * fix: configurations provider * chore: add all contracts * chore(admin): add workflow contracts (#18707) * chore(admin): add audit-logs contracts (#18708) * chore: convert users page to TS (#18710) * chore(admin): convert Roles Settings (#18774) * chore(admin): fix types from merge * chore(admin): convert Single Sign On settings page to TS and refactoring * chore: pretty --------- Co-authored-by: HichamELBSI <elabbassih@gmail.com>
88 lines
1.7 KiB
TypeScript
88 lines
1.7 KiB
TypeScript
import type { errors } from '@strapi/utils';
|
|
import { Permission } from './shared';
|
|
|
|
export interface Action {
|
|
actionId: string;
|
|
applyToProperties: string[];
|
|
label: string;
|
|
subjects: string[];
|
|
}
|
|
|
|
export interface SubjectProperty {
|
|
children?: SubjectProperty[];
|
|
label: string;
|
|
required?: boolean;
|
|
value: string;
|
|
}
|
|
|
|
export interface Subject {
|
|
label: string;
|
|
properties: SubjectProperty[];
|
|
uid: string;
|
|
}
|
|
|
|
export interface ContentPermission {
|
|
actions: Action[];
|
|
subjects: Subject[];
|
|
}
|
|
|
|
export interface SettingPermission {
|
|
action: string;
|
|
displayName: string;
|
|
category: string;
|
|
subCategory: string;
|
|
}
|
|
|
|
export interface PluginPermission {
|
|
action: string;
|
|
displayName: string;
|
|
plugin: string;
|
|
subCategory: string;
|
|
}
|
|
|
|
export interface Condition {
|
|
id: string;
|
|
displayName: string;
|
|
category: string;
|
|
}
|
|
|
|
/**
|
|
* GET /permission - List all permissions
|
|
*/
|
|
export declare namespace GetAll {
|
|
export interface Request {
|
|
query: {};
|
|
body: {};
|
|
}
|
|
|
|
export interface Response {
|
|
data: {
|
|
conditions: Condition[];
|
|
sections: {
|
|
collectionTypes: ContentPermission;
|
|
plugins: PluginPermission[];
|
|
settings: SettingPermission[];
|
|
singleTypes: ContentPermission;
|
|
};
|
|
};
|
|
error?: errors.ApplicationError;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* POST /permission/check - Check if the current user has the given permissions
|
|
*/
|
|
export declare namespace Check {
|
|
export interface Request {
|
|
query: {};
|
|
body: {
|
|
permissions: (Pick<Permission, 'action' | 'subject'> & { field?: string })[];
|
|
};
|
|
}
|
|
|
|
export interface Response {
|
|
data: boolean[];
|
|
error?: errors.ApplicationError | errors.YupValidationError;
|
|
}
|
|
}
|