Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
2.1.0
-
None
-
None
Description
Currently user<-> privileges is implemented to handle privileges to owners of the respective objects. There can not be more than one owner to single object (database/table) so restriction should be added either at the application or the database schema to prevent it from happening.
I feel schema change is the best way to do it for now as there is no plan to implement user privileges in near future. In future when user privileges feature is implemented this change could be reverted and restriction can be added at application.
Current Schema:
ALTER TABLE `SENTRY_USER_DB_PRIVILEGE_MAP` ADD CONSTRAINT `SENTRY_USER_DB_PRIVILEGE_MAP_PK` PRIMARY KEY (`USER_ID`,`DB_PRIVILEGE_ID`);
Proposed Solution:
ALTER TABLE `SENTRY_USER_DB_PRIVILEGE_MAP` ADD CONSTRAINT `SENTRY_USER_DB_PRIVILEGE_MAP_PK` PRIMARY KEY (`DB_PRIVILEGE_ID`);
With this change DB_PRIVILEGE_ID would be the primary key and this restrict same privilege to be granted to another user.