Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: uniqueness constraints are not enforced when creating CoreObjectPermission and CoreGlobalPermission nodes #5132

Closed
wvandeun opened this issue Dec 3, 2024 · 0 comments · Fixed by #5195 or #5203
Assignees
Labels
group/backend Issue related to the backend (API Server, Git Agent) priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release type/bug Something isn't working as expected

Comments

@wvandeun
Copy link
Contributor

wvandeun commented Dec 3, 2024

Component

API Server / GraphQL

Infrahub version

stable

Current Behavior

You can create duplicate CoreObjectPermission and CoreGlobalPermission nodes that violate the uniqueness constraints that they have defined on them. However the schema integrity check in the CI does seem to pick up the issue.

CoreObjectPermission has an uniqueness constraint on namespace__value, name__value, action__value, decision__value
CoreGlobalPermission has an uniqueness constraint on action__value, decision__value

Expected Behavior

You cannot create duplicate object permission or global permission objects, or the uniqueness constraints have to be removed.

Steps to Reproduce

  • load an instance of infrahub
  • navigate to admin > users & permissions
  • navigate to the global permissions tab
  • create the global permission global:manage_schema:allow_all 2 times
  • navigate to the object permissions tab
  • create the object permission object:*:Tag:create:allow_all 2 times
  • create a branch
  • create a new tag object in the branch
  • open a proposed change for the branch
  • wait for CI to complete, schema integrity check will have failed

Additional Information

No response

@wvandeun wvandeun added type/bug Something isn't working as expected group/backend Issue related to the backend (API Server, Git Agent) labels Dec 3, 2024
@wvandeun wvandeun changed the title bug: CoreObjectPermission and CoreGlobalPermission uniqueness constraints are not enforced bug: CoreObjectPermission and CoreGlobalPermission uniqueness constraints are not enforced when creating them Dec 3, 2024
@exalate-issue-sync exalate-issue-sync bot changed the title bug: CoreObjectPermission and CoreGlobalPermission uniqueness constraints are not enforced when creating them bug: CoreObjectPermission and CoreGlobalPermission uniqueness constraints are not enforced Dec 3, 2024
@wvandeun wvandeun changed the title bug: CoreObjectPermission and CoreGlobalPermission uniqueness constraints are not enforced bug: uniqueness constraints are not enforced when creating CoreObjectPermission and CoreGlobalPermission nodes Dec 3, 2024
@exalate-issue-sync exalate-issue-sync bot added the priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release label Dec 3, 2024
@gmazoyer gmazoyer linked a pull request Dec 12, 2024 that will close this issue
@exalate-issue-sync exalate-issue-sync bot added the state/need-testing This issue is ready and needs to be tested. label Dec 12, 2024
@gmazoyer gmazoyer linked a pull request Dec 12, 2024 that will close this issue
@exalate-issue-sync exalate-issue-sync bot removed the state/need-testing This issue is ready and needs to be tested. label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release type/bug Something isn't working as expected
Projects
None yet
2 participants