Skip to content

Commit

Permalink
fix: update label creation permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
vamsikrishnamathala committed Feb 5, 2025
1 parent 04c0569 commit 89abbcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export const IssueLabelSelect: React.FC<IIssueLabelSelect> = observer((props) =>
const [query, setQuery] = useState("");
const [submitting, setSubmitting] = useState<boolean>(false);

const canCreateLabel = allowPermissions([EUserPermissions.ADMIN], EUserPermissionsLevel.PROJECT);
const canCreateLabel =
projectId && allowPermissions([EUserPermissions.ADMIN], EUserPermissionsLevel.PROJECT, workspaceSlug, projectId);

const projectLabels = getProjectLabels(projectId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export const LabelDropdown = (props: ILabelDropdownProps) => {
const storeLabels = getProjectLabels(projectId);
const { allowPermissions } = useUserPermissions();

const canCreateLabel = allowPermissions([EUserPermissions.ADMIN], EUserPermissionsLevel.PROJECT, workspaceSlug);
const canCreateLabel =
projectId && allowPermissions([EUserPermissions.ADMIN], EUserPermissionsLevel.PROJECT, workspaceSlug, projectId);

let projectLabels: IIssueLabel[] = defaultOptions;
if (storeLabels && storeLabels.length > 0) projectLabels = storeLabels;
Expand Down

0 comments on commit 89abbcf

Please sign in to comment.