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

Implement access level methods in UserApiClient. #283

Merged
merged 1 commit into from Sep 30, 2020

Conversation

DiscoPYF
Copy link
Collaborator

@DiscoPYF DiscoPYF commented Sep 26, 2020

fix #282

Implemented the following methods:

  • PutDatabaseAccessLevelAsync
  • GetDatabaseAccessLevelAsync
  • DeleteDatabaseAccessLevelAsync
  • GetAccessibleDatabasesAsync
  • PutCollectionAccessLevelAsync
  • GetCollectionAccessLevelAsync
  • DeleteCollectionAccessLevelAsync

Also added related data models and unit tests.

I would like to draw attention on the following endpoint: GET /_api/user/{user}/database/, represented by GetAccessibleDatabasesAsync and the response GetAccessibleDatabasesResponse.

https://www.arangodb.com/docs/stable/http/user-management.html#list-the-accessible-databases-for-a-user

The type of the values in the result property of the response will change if the query parameter full is provided.

Example without full:

"result" : { 
    "_system" : "rw" 
  } 

Example with full:

"result" : { 
    "_system" : { 
      "permission" : "rw", 
      "collections" : { 
        "_fishbowl" : "undefined", 
        "*" : "undefined" 
      } 
   }
}

So I used Dictionary<string, object> for the property type in the C# response model, with a doc comment to explain what to expect.

@DiscoPYF DiscoPYF requested a review from a team September 26, 2020 14:55
@rossmills99 rossmills99 merged commit a8ad515 into ArangoDB-Community:master Sep 30, 2020
@DiscoPYF DiscoPYF deleted the accessLevelUserApi branch September 30, 2020 13:59
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.

Implement access level methods for UserApiClient
2 participants