ra0o0f / arangoclient.net

ArangoDB .NET Client with LINQ support
Apache License 2.0
99 stars 37 forks source link

Confused with SystemDatabaseCredential #119

Closed imtrobin closed 5 years ago

imtrobin commented 5 years ago

Hi, I'm abit confused with what SystemDatabaseCredential is for, I did some testing, some functions like CreateDatabaseAsync needs it , while others like ListAccessibleDatabasesAsync needs Credential. Is there a doc or something we can reference?

ra0o0f commented 5 years ago

@imtrobin operations like CreateDatabase needs system privilege. these operation use SystemDatabaseCredential and other use DatabaseCredential. i separate credentials so end-users can set limited-access-user (not root) for regular operations.

imtrobin commented 5 years ago

Yes, I assume so. Is there a list we can check? Cos it seems insert a document also needs SystemDatabaseCredential, which I found it odd.

ra0o0f commented 5 years ago

@imtrobin note that when SystemDatabaseCredential is used in an operation(like creating database), all request will be use _system, so inserting document should not use SystemDatabaseCredential, if it is, its a bug

imtrobin commented 5 years ago

I did some more testing. I confirm

  1. Creating database needs SystemCredential
  2. Creating collection do not need SystemCredential, just Credential
  3. Creating doc do not need SystemCredential, just Credential, with user that has permission Administrate.

Is that correct?

ra0o0f commented 5 years ago

@imtrobin absolutely. for more clarification:

  1. Creating database needs SystemCredential because it is perform on _system database. only _system can create database.

Creating collection do not need SystemCredential, just Credential because it is perform on the database which is set on DatabaseSetting.Database which credentials are set on DatabaseSetting.Credential