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

MG-2069 - Remove relation requirement from entity unassignment #2130

Merged
merged 7 commits into from
Apr 23, 2024

Conversation

WashingtonKK
Copy link
Contributor

What type of PR is this?

This is a refactor because it changes the following functionality: Unassign entity.

What does this do?

Removes the relation requirement from unassigning an entity. When the relation is provided, only the user with that relation is removed, when not provided - all relations are removed.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Yes, I have included tests for my changes.

Did you document any new/modified feature?

No

Notes

Signed-off-by: WashingtonKK [email protected]

@WashingtonKK WashingtonKK self-assigned this Apr 2, 2024
@WashingtonKK WashingtonKK marked this pull request as ready for review April 2, 2024 15:30
auth/spicedb/policies.go Outdated Show resolved Hide resolved
auth/service.go Outdated Show resolved Hide resolved
auth/service.go Outdated Show resolved Hide resolved
@WashingtonKK WashingtonKK force-pushed the MG-2069 branch 6 times, most recently from 3ad6f7b to bdfebc7 Compare April 17, 2024 08:53
@WashingtonKK WashingtonKK force-pushed the MG-2069 branch 3 times, most recently from d3042c7 to 1b94b17 Compare April 19, 2024 08:00
rodneyosodo
rodneyosodo previously approved these changes Apr 19, 2024
Copy link
Member

@rodneyosodo rodneyosodo left a comment

Choose a reason for hiding this comment

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

LGTM

@WashingtonKK WashingtonKK force-pushed the MG-2069 branch 2 times, most recently from 672668d to f374c4d Compare April 19, 2024 10:22
Copy link
Collaborator

@dborovcanin dborovcanin left a comment

Choose a reason for hiding this comment

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

This starts to be a little cryptic and complex. We must simplify, but let's not do that in this PR.

auth/service.go Outdated Show resolved Hide resolved
auth/service.go Outdated Show resolved Hide resolved
rodneyosodo
rodneyosodo previously approved these changes Apr 23, 2024
Signed-off-by: WashingtonKK <[email protected]>

Remove relation requirement from validate

Signed-off-by: WashingtonKK <[email protected]>

fix remove policies

Signed-off-by: WashingtonKK <[email protected]>

feat: remove policy check

Signed-off-by: WashingtonKK <[email protected]>

fix: ci

Signed-off-by: WashingtonKK <[email protected]>

fix: tests

Signed-off-by: WashingtonKK <[email protected]>

fix tests

Signed-off-by: WashingtonKK <[email protected]>

fix api docs

Signed-off-by: WashingtonKK <[email protected]>

fix: property based tests

Signed-off-by: WashingtonKK <[email protected]>

revert add policies

Signed-off-by: WashingtonKK <[email protected]>

Refactor relation check

Signed-off-by: WashingtonKK <[email protected]>

fix: ci

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>

enhance relation query

Signed-off-by: WashingtonKK <[email protected]>

refactor query

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
auth/service.go Outdated Show resolved Hide resolved
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
@dborovcanin dborovcanin merged commit 07635ad into absmach:main Apr 23, 2024
6 checks passed
@WashingtonKK WashingtonKK deleted the MG-2069 branch April 23, 2024 08:58
AND object_id = :object_id
`
if pc.Relation != "" {
q = fmt.Sprintf("%s AND relation = :relation", q)
Copy link
Contributor

@arvindh123 arvindh123 Apr 23, 2024

Choose a reason for hiding this comment

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

@WashingtonKK There will be only one relation in the Domain.
So no need to consider relation here

Copy link
Collaborator

Choose a reason for hiding this comment

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

@WashingtonKK Please check this one and send a follow-up PR for it.

JeffMboya pushed a commit to JeffMboya/supermq that referenced this pull request May 15, 2024
JeffMboya pushed a commit to JeffMboya/supermq that referenced this pull request May 15, 2024
andychao217 pushed a commit to andychao217/magistrala that referenced this pull request Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Relationship might not be required for unassigning User for Entity
4 participants