absmach / magistrala

Industrial IoT Messaging and Device Management Platform
https://www.abstractmachines.fr/magistrala.html
Apache License 2.0
2.47k stars 671 forks source link

Bug: Domain retrieval for domain members (not the owner) fails with authorisation error #2217

Closed SammyOina closed 3 months ago

SammyOina commented 4 months ago

What were you trying to achieve?

Retrieve a domain by a domain member account using the sdk

What are the expected results?

Retrieve the domain successfully

What are the received results?

failed authorization

Method retrieve_domain for domain id 389efe9b-2e7a-41a1-9ce8-1f910baa93bd took 4.297028ms to complete with error: failed to perform authorization over the entity : failed to perform authorization over the entity : failed to perform authorization over the entity : PERMISSIONSHIP_NO_PERMISSION.

Steps To Reproduce

Create domain invite user to domain accept invitation login to domain as the invited user

token, err := svc.OrganizationLogin(
            mgsdk.Login{
                DomainID: req.OrgID,
            },
            req.Token,
        )

retrieve domain

s.Token = token.AccessToken
domain, err := uis.mgsdk.Domain(s.Domain.ID, s.Token)

In what environment did you encounter the issue?

testing on prism UI with magistrala v0.14

Additional information you deem important

No response

SammyOina commented 3 months ago

this was a bug based on change in returned status code from the API and has been resolved