[ 
https://issues.apache.org/jira/browse/SENTRY-2242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16489257#comment-16489257
 ] 

kalyan kumar kalvagadda commented on SENTRY-2242:
-------------------------------------------------

[~LinaAtAustin] I understand this does not solve all the cases. It only solves 
the case of not having multiple users as owners to same object.

It will not be an upgrade issue. When user privileges is implemented in future, 
one needs to include the 'user_id' to  the key. This is like loosening the key. 
Making this change will not cause any issue with the existing data.

> Add schema changes to limit one one user as owner privilege per object
> ----------------------------------------------------------------------
>
>                 Key: SENTRY-2242
>                 URL: https://issues.apache.org/jira/browse/SENTRY-2242
>             Project: Sentry
>          Issue Type: Sub-task
>          Components: Sentry
>    Affects Versions: 2.1.0
>            Reporter: kalyan kumar kalvagadda
>            Assignee: kalyan kumar kalvagadda
>            Priority: Major
>
> 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:*
> {noformat}
> ALTER TABLE `SENTRY_USER_DB_PRIVILEGE_MAP`
>   ADD CONSTRAINT `SENTRY_USER_DB_PRIVILEGE_MAP_PK` PRIMARY KEY 
> (`USER_ID`,`DB_PRIVILEGE_ID`);
> {noformat}
> *Proposed Solution:*
> {noformat}
> ALTER TABLE `SENTRY_USER_DB_PRIVILEGE_MAP`
>   ADD CONSTRAINT `SENTRY_USER_DB_PRIVILEGE_MAP_PK` PRIMARY KEY 
> (`DB_PRIVILEGE_ID`);
> {noformat}
> With this change DB_PRIVILEGE_ID would be the primary key and this restrict 
> same privilege  to be granted to another user.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to