/
githubmirror
/
strapi
Обзор
Документация
Войти
/
githubmirror
/
strapi
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/core/admin/shared/contracts/permissions.ts
91 строка
2 KB
mathildeleg
fix(admin): restore default locale in permissions when adding i18n to ct (#26548)
29 июн 2026, 10:22
Не верифицирован
29 июн 2026, 10:22
cbbac85
Код
Авторство
О чём код?
import type { errors } from '@strapi/utils'; import { Entity, Permission } from './shared'; export interface Action { actionId: string; applyToProperties: string[]; label: string; subjects: string[]; } export interface SubjectProperty { children?: SubjectProperty[]; isDefault?: boolean; 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: {}; params: { role: Entity['id']; }; } 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; } }