absmach / magistrala

Industrial IoT Messaging and Device Management Platform

Home Page:https://www.abstractmachines.fr/magistrala.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

SammyOina opened this issue · comments

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

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