Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat(frontend): Allow workspace owner and DBA to edit issue name and description (#3405)

Liu Jie412ab50f409
diff --git a/frontend/src/components/Issue/logic/extra.ts b/frontend/src/components/Issue/logic/extra.ts
index d26bd0dda8..a8e3de317f 100644
--- a/frontend/src/components/Issue/logic/extra.ts
+++ b/frontend/src/components/Issue/logic/extra.ts
@@ -1,12 +1,13 @@
+import { computed, nextTick } from "vue";
import { cloneDeep, isEqual } from "lodash-es";
-import { InputField, OutputField } from "@/plugins";
+
import {
useCurrentUser,
useIssueStore,
useIssueSubscriberStore,
useTaskStore,
} from "@/store";
-import {
+import type {
Issue,
IssueCreate,
IssueStatus,
@@ -20,8 +21,9 @@ import {
TaskStatus,
TaskStatusPatch,
} from "@/types";
+import type { InputField, OutputField } from "@/plugins";
import { useIssueLogic } from "./index";
-import { computed, nextTick } from "vue";
+import { hasWorkspacePermission } from "@/utils";
export const useExtraIssueLogic = () => {
const {
@@ -59,11 +61,27 @@ export const useExtraIssueLogic = () => {
}
const issueEntity = issue.value as Issue;
- return (
- issueEntity.status == "OPEN" &&
- (issueEntity.assignee.id == currentUser.value.id ||
- issueEntity.creator.id == currentUser.value.id)
- );
+ if (issueEntity.status === "OPEN") {
+ if (
+ issueEntity.assignee.id === currentUser.value.id ||
+ issueEntity.creator.id === currentUser.value.id
+ ) {
+ // Allowed if current user is the assignee or creator.
+ return true;
+ }
+
+ if (
+ hasWorkspacePermission(
+ "bb.permission.workspace.manage-issue",
+ currentUser.value.role
+ )
+ ) {
+ // Allowed if RBAC is enabled and current is DBA or workspace owner.
+ return true;
+ }
+ }
+
+ return false;
});
const updateName = (