清理全局角色残留并修复项目权限判断
This commit is contained in:
@@ -52,12 +52,22 @@ describe("project management access", () => {
|
||||
expect(source).toContain("canProject(scope.row, 'audit_export', 'read')");
|
||||
});
|
||||
|
||||
it("opens project names in management detail when the user has setup config write permission", () => {
|
||||
it("opens project names in management detail when the user has setup config read permission", () => {
|
||||
const source = readProjects();
|
||||
|
||||
expect(source).toContain("v-if=\"canProject(scope.row, 'setup_config', 'write')\"");
|
||||
expect(source).toContain("v-if=\"canProject(scope.row, 'setup_config', 'read')\"");
|
||||
expect(source).toContain('@click="goProject(scope.row)" class="project-name"');
|
||||
expect(source).toContain('@click="enterStudy(scope.row)"');
|
||||
expect(source).toContain('if (!canProject(row, "setup_config", "write"))');
|
||||
expect(source).toContain('if (!canProject(row, "setup_config", "read"))');
|
||||
});
|
||||
|
||||
it("keeps audit export write mappings on the export operation", () => {
|
||||
const projects = readProjects();
|
||||
const router = readRouter();
|
||||
|
||||
expect(projects).toContain('audit_export: { read: "audit_logs:read", write: "audit_logs:export" }');
|
||||
expect(router).toContain('audit_export: { read: "audit_logs:read", write: "audit_logs:export" }');
|
||||
expect(projects).not.toContain('audit_export: { read: "audit_logs:read", write: "audit_logs:read" }');
|
||||
expect(router).not.toContain('audit_export: { read: "audit_logs:read", write: "audit_logs:read" }');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user