feat: settings page update

This commit is contained in:
ivannoskov
2026-02-02 21:29:06 +03:00
parent 735077e707
commit 233bdf7907
6 changed files with 140 additions and 112 deletions

View File

@@ -64,11 +64,15 @@ export type PermissionKey =
| "admin_full"
| "projects_read"
| "projects_write"
| "creatives_read"
| "creatives_write"
| "placements_read"
| "placements_write"
| "analytics_read";
| "analytics_read"
| "analytics_without_clicks"
| "analytics_own_creatives";
export type PermissionScopeType = "project";
export type PermissionScopeType = "project" | "creative" | "placement";
export interface PermissionScope {
type: PermissionScopeType;
@@ -80,6 +84,32 @@ export interface Permission {
scopes?: PermissionScope[];
}
export const PERMISSION_LABELS: Record<PermissionKey, string> = {
admin_full: "Полный доступ",
projects_read: "Просмотр проектов",
projects_write: "Редактирование проектов",
creatives_read: "Просмотр креативов",
creatives_write: "Создание/редактирование креативов",
placements_read: "Просмотр планов закупок",
placements_write: "Создание/редактирование закупок",
analytics_read: "Полный доступ к статистике",
analytics_without_clicks: "Статистика без переходов",
analytics_own_creatives: "Статистика только своих креативов",
};
export const ALL_PERMISSIONS: PermissionKey[] = [
"admin_full",
"projects_read",
"projects_write",
"creatives_read",
"creatives_write",
"placements_read",
"placements_write",
"analytics_read",
"analytics_without_clicks",
"analytics_own_creatives",
];
export interface WorkspaceMemberUser {
id: string; // user_id
telegram_id: number;