Add project:manage_members, CSP frame-src, task-run member view, CreateUser tx error handling, ERR_NO_PROJECT chat gate, and creator-scoped project name/client_key uniqueness to stop duplicate creates and auth gaps. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
1.6 KiB
Go
27 lines
1.6 KiB
Go
package authz
|
|
|
|
// PermissionCatalogEntry 权限目录项。
|
|
type PermissionCatalogEntry struct {
|
|
Key string `json:"key"`
|
|
Resource string `json:"resource"`
|
|
Action string `json:"action"`
|
|
RiskLevel string `json:"risk_level"`
|
|
Description string `json:"description,omitempty"`
|
|
}
|
|
|
|
// PermissionCatalog 返回系统权限目录(与 DB seed 对齐,供前端渲染)。
|
|
func PermissionCatalog() []PermissionCatalogEntry {
|
|
return []PermissionCatalogEntry{
|
|
{Key: "project:create", Resource: "project", Action: "create", RiskLevel: "normal", Description: "创建新项目"},
|
|
{Key: "project:assign_lead", Resource: "project", Action: "assign_lead", RiskLevel: "elevated", Description: "指派项目负责人"},
|
|
{Key: PermManageProjectMembers, Resource: "project", Action: "manage_members", RiskLevel: "elevated", Description: "管理项目成员(添加/调整/移出)"},
|
|
{Key: PermManage, Resource: "system", Action: "manage", RiskLevel: "critical", Description: "系统权限管理"},
|
|
{Key: "workflow:config_visibility", Resource: "workflow", Action: "config_visibility", RiskLevel: "elevated"},
|
|
{Key: "doc:override_visibility", Resource: "document", Action: "override_visibility", RiskLevel: "elevated"},
|
|
{Key: "doc:export", Resource: "document", Action: "export", RiskLevel: "normal"},
|
|
{Key: "workflow:view_all", Resource: "workflow", Action: "view_all", RiskLevel: "normal"},
|
|
{Key: "workflow_defs.publish", Resource: "workflow_defs", Action: "publish", RiskLevel: "elevated"},
|
|
{Key: "templates.publish", Resource: "templates", Action: "publish", RiskLevel: "elevated"},
|
|
}
|
|
}
|