Skip to content

Conversation

aakashreddy-p
Copy link
Contributor

@aakashreddy-p aakashreddy-p commented Sep 17, 2025

Description

I have condition to check role based access along with workspace check.

Add Issue Number

Fixes #jira

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • I have linked an issue to the pull request.
  • I have linked a PR type label to the pull request.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.

@aakashreddy-p aakashreddy-p self-assigned this Sep 17, 2025
@aakashreddy-p aakashreddy-p added the pr-bugfix This PR fixes a bug label Sep 17, 2025
@aakashreddy-p aakashreddy-p changed the title fix: condition check for insert generate variable fix: condition check for insert generated variable Sep 17, 2025
Comment on lines 1385 to 1399
const matchingUser = workspaceDetails.users?.find(
(currentUser) => currentUser.id === user._id.toString(),
);
if (!matchingUser) {
throw new NotFoundException(
`User with ${user.email} not found in workspace.`,
);
}
if (
matchingUser.role !== WorkspaceRole.ADMIN &&
matchingUser.role !== WorkspaceRole.EDITOR
) {
throw new ForbiddenException(
"You do not have permission to modify generated variables.",
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already had a function for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend pr-bugfix This PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants