Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Wrong example for the field data-type: user / service of the Authorization section in the documentations #992

Open
MahshidZ opened this issue Dec 28, 2018 · 2 comments

Comments

@MahshidZ
Copy link
Contributor

Problem

I believe the following section in the documentation does not match with the example provided afterward:

Here is a sample request with an authorization section. It gives read, write, and admin access to a single attribute, of type service:

However, in the example after that, there is no data-type service.

"authorization": {
"admins": [{"data_type": "user", "value": "bfawlty"}],
"readers": [{"data_type": "user", "value": "bfawlty"}],
"writers": [{"data_type": "user", "value": "bfawlty"}]
}

Suggested fix

I would suggest option 3, to show the two types together

Option 1

Change "service" to "user"

Here is a sample request with an authorization section. It gives read, write, and admin access to a single attribute, of data_type user:

Option 2

Provide an example of data-type Service

  "authorization": {
    "admins": [{"data_type": "service", "value": "serviceA"}],
    "readers": [{"data_type": "service", "value": "serviceB"}],
    "writers": [{"data_type": "service", "value": "serviceC"}]
  }

Option 3

Provide an example with the mix of data-type Service and User:
Combine option 1 and 2; so change both the text and the example to reflect both data-types.

  "authorization": {
    "admins": [{"data_type": "service", "value": "serviceA"}],
    "readers": [{"data_type": "user", "value": "userA"}],
    "writers": [{"data_type": "user", "value": "userB"}]
  }
@lmontrieux
Copy link
Contributor

Thank you @MahshidZ for reporting this issue. I think the easiest fix is option 1, but I'll be happy with any one of the three options you suggest. Would you like to open a pull request?

@MahshidZ
Copy link
Contributor Author

MahshidZ commented Jan 2, 2019

Thank you @MahshidZ for reporting this issue. I think the easiest fix is option 1, but I'll be happy with any one of the three options you suggest. Would you like to open a pull request?

Sure, will create a pull request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants