Ivan
Ivan

Reputation: 23

Possible to create a user for a specific database only?

According to the BaseX documentation about user management, it is possible to create a set of users with certain permissions (READ, WRITE, etc..). These permissions have effect on what database operations can be executed.

This leads to my question: is it possible to create users that only have access to a certain database?

For example:

user 'admin' -> db1, db2, ...
user 'bob'   -> db1
user 'alice' -> db2

I played a little bit around with the users and it seems that every user can "see" every database created in BaseX. For Example if bob hat WRITE access, he can write to db1, db2 and not only db1.

Upvotes: 0

Views: 106

Answers (1)

chrisis
chrisis

Reputation: 1993

According to the documentation you link to if you

CREATE USER bob

bob will have no permissions at all. Then

GRANT WRITE ON db1 to bob

The user bob will only have access to db1. Note that user management has changed over BaseX versions so on an older version you may have to explicitly GRANT none to bob before granting the more specific permissions.

Upvotes: 0

Related Questions