feat(版本): 完善研发计划与预警已读
关键改动: - 增加版本表单、发布校验和调研方向进度规则 - 扩展小宝预警已读状态、风险签名和今日证据 - 补充组长权限、加班查看范围、活动记录与相关测试 Co-Authored-By: Codex GPT-5 <codex@openai.com>
This commit is contained in:
@@ -105,8 +105,26 @@ export const DEFAULT_ROLE_PERMISSIONS: Record<string, string[]> = {
|
||||
'xiaobao.warning:view',
|
||||
'overtime:view', 'overtime:create',
|
||||
],
|
||||
'role-lead': [
|
||||
...VIEW_ONLY_BASE,
|
||||
'version.research:view', 'version.product_plan:view', 'version.ui_plan:view',
|
||||
'version.devtask:view', 'version.devtask:manage',
|
||||
'version.testcase:view', 'version.testcase:manage',
|
||||
'version.bug:view', 'version.bug:create', 'version.bug:edit', 'version.bug:delete',
|
||||
'xiaobao.warning:view',
|
||||
'overtime:view', 'overtime:create', 'overtime:export',
|
||||
],
|
||||
};
|
||||
|
||||
export const DEFAULT_ROLE_PRESETS: RoleItem[] = [
|
||||
{ id: 'role-admin', name: '超级管理员', description: '拥有系统全部权限', createdAt: '2024-01-01', isSystem: true, permissions: DEFAULT_ROLE_PERMISSIONS['role-admin'] },
|
||||
{ id: 'role-pm', name: '产品经理', description: '管理产品和需求', createdAt: '2024-01-01', permissions: DEFAULT_ROLE_PERMISSIONS['role-pm'] },
|
||||
{ id: 'role-lead', name: '组长', description: '管理本组任务和本部门加班记录', createdAt: '2024-01-01', permissions: DEFAULT_ROLE_PERMISSIONS['role-lead'] },
|
||||
{ id: 'role-dev', name: '开发工程师', description: '负责开发任务', createdAt: '2024-01-01', permissions: DEFAULT_ROLE_PERMISSIONS['role-dev'] },
|
||||
{ id: 'role-test', name: '测试工程师', description: '负责测试任务', createdAt: '2024-01-01', permissions: DEFAULT_ROLE_PERMISSIONS['role-test'] },
|
||||
{ id: 'role-design', name: '设计师', description: '负责UI/UX设计', createdAt: '2024-01-01', permissions: DEFAULT_ROLE_PERMISSIONS['role-design'] },
|
||||
];
|
||||
|
||||
export function hasPermission(role: RoleItem | undefined, permission: string): boolean {
|
||||
if (!role) return false;
|
||||
if (role.permissions.includes('*')) return true;
|
||||
|
||||
Reference in New Issue
Block a user