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-2075 - Add guest relation #2228

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

nyagamunene
Copy link
Contributor

What type of PR is this?

This is a feature because it adds a policy to a domain member to restrict the creation of new entities such as things, channels and groups in a domain

What does this do?

It adds a guest relation policy to a domain member to restrict the creation of new entities such as things, channels and groups in a domain

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

Have you included tests for your changes?

No

Did you document any new/modified feature?

No

Notes

@nyagamunene nyagamunene self-assigned this May 13, 2024
@nyagamunene nyagamunene force-pushed the MG-2075-PolicyForDomainMemberToRestrictOnCreationNewEntities branch 2 times, most recently from ef2287b to 483084a Compare May 15, 2024 14:26
@nyagamunene nyagamunene marked this pull request as ready for review May 15, 2024 15:05
users/service.go Outdated
@@ -113,6 +113,7 @@ func (svc service) IssueToken(ctx context.Context, identity, secret, domainID st

token, err := svc.auth.Issue(ctx, &magistrala.IssueReq{UserId: dbUser.ID, DomainId: &d, Type: uint32(auth.AccessKey)})
if err != nil {
fmt.Println(err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this log line

@nyagamunene nyagamunene changed the title MG-2075-Add guest relation MG-2075 - Add guest relation May 21, 2024
@nyagamunene nyagamunene force-pushed the MG-2075-PolicyForDomainMemberToRestrictOnCreationNewEntities branch 2 times, most recently from a5b8018 to 185a83d Compare May 21, 2024 11:45
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
@nyagamunene nyagamunene force-pushed the MG-2075-PolicyForDomainMemberToRestrictOnCreationNewEntities branch from 185a83d to 25b1b39 Compare May 27, 2024 09:51
arvindh123
arvindh123 previously approved these changes May 28, 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.

Update SDK godocs

users/service.go Outdated
@@ -113,6 +113,7 @@ func (svc service) IssueToken(ctx context.Context, identity, secret, domainID st

token, err := svc.auth.Issue(ctx, &magistrala.IssueReq{UserId: dbUser.ID, DomainId: &d, Type: uint32(auth.AccessKey)})
if err != nil {
fmt.Println(err.Error())
Copy link
Member

Choose a reason for hiding this comment

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

Remove debug statements

@@ -575,6 +575,8 @@ func SwitchToPermission(relation string) string {
return ViewPermission
case MemberRelation:
return MembershipPermission
case GuestRelation:
Copy link
Member

Choose a reason for hiding this comment

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

Update this test too TestSwitchToPermission

Copy link
Member

Choose a reason for hiding this comment

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

also TestCheckRelation

Signed-off-by: nyagamunene <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants