Re: Review Request 68452: SENTRY-2359: Object owner is unable to grant privileges: SentryAccessDeniedException

2018-08-22 Thread kalyan kumar kalvagadda via Review Board


> On Aug. 22, 2018, 3:58 p.m., Na Li wrote:
> > sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
> > Line 3001 (original), 3007 (patched)
> > 
> >
> > why do you change exception type? SentryInvalidInputException is 
> > derived from SentryUserException

Becausse getMSentryPrivilegesByUserNameIfExists throws Exception.


- kalyan kumar


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68452/#review207752
---


On Aug. 22, 2018, 10:40 a.m., kalyan kumar kalvagadda wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68452/
> ---
> 
> (Updated Aug. 22, 2018, 10:40 a.m.)
> 
> 
> Review request for sentry, Na Li and Sergio Pena.
> 
> 
> Bugs: SENTRY-2359
> https://issues.apache.org/jira/browse/SENTRY-2359
> 
> 
> Repository: sentry
> 
> 
> Description
> ---
> 
> Added code changes to look for owner privilege for roles and users while 
> authorizing a privilege grant request.
> 
> 
> Diffs
> -
> 
>   
> sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryPrivilege.java
>  1decef2bafb98cdeb98f7d570eecdcc705f8249f 
>   
> sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
>  8b32e7b2f7b12cf2aa60eb955f72db85afbe41cd 
>   
> sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestOwnerPrivilegesWithGrantOption.java
>  b3d98cb319916b2272c10ea0b39d91d4b118df3e 
> 
> 
> Diff: https://reviews.apache.org/r/68452/diff/3/
> 
> 
> Testing
> ---
> 
> Added new test to verify the same and also made sure that all the existing 
> tests passed.
> 
> 
> Thanks,
> 
> kalyan kumar kalvagadda
> 
>



Re: Review Request 68452: SENTRY-2359: Object owner is unable to grant privileges: SentryAccessDeniedException

2018-08-22 Thread Na Li via Review Board

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68452/#review207753
---


Ship it!




Ship It!

- Na Li


On Aug. 22, 2018, 10:40 a.m., kalyan kumar kalvagadda wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68452/
> ---
> 
> (Updated Aug. 22, 2018, 10:40 a.m.)
> 
> 
> Review request for sentry, Na Li and Sergio Pena.
> 
> 
> Bugs: SENTRY-2359
> https://issues.apache.org/jira/browse/SENTRY-2359
> 
> 
> Repository: sentry
> 
> 
> Description
> ---
> 
> Added code changes to look for owner privilege for roles and users while 
> authorizing a privilege grant request.
> 
> 
> Diffs
> -
> 
>   
> sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryPrivilege.java
>  1decef2bafb98cdeb98f7d570eecdcc705f8249f 
>   
> sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
>  8b32e7b2f7b12cf2aa60eb955f72db85afbe41cd 
>   
> sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestOwnerPrivilegesWithGrantOption.java
>  b3d98cb319916b2272c10ea0b39d91d4b118df3e 
> 
> 
> Diff: https://reviews.apache.org/r/68452/diff/3/
> 
> 
> Testing
> ---
> 
> Added new test to verify the same and also made sure that all the existing 
> tests passed.
> 
> 
> Thanks,
> 
> kalyan kumar kalvagadda
> 
>



Re: Review Request 68452: SENTRY-2359: Object owner is unable to grant privileges: SentryAccessDeniedException

2018-08-22 Thread Na Li via Review Board

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68452/#review207752
---




sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
Line 3001 (original), 3007 (patched)


why do you change exception type? SentryInvalidInputException is derived 
from SentryUserException


- Na Li


On Aug. 22, 2018, 10:40 a.m., kalyan kumar kalvagadda wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68452/
> ---
> 
> (Updated Aug. 22, 2018, 10:40 a.m.)
> 
> 
> Review request for sentry, Na Li and Sergio Pena.
> 
> 
> Bugs: SENTRY-2359
> https://issues.apache.org/jira/browse/SENTRY-2359
> 
> 
> Repository: sentry
> 
> 
> Description
> ---
> 
> Added code changes to look for owner privilege for roles and users while 
> authorizing a privilege grant request.
> 
> 
> Diffs
> -
> 
>   
> sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryPrivilege.java
>  1decef2bafb98cdeb98f7d570eecdcc705f8249f 
>   
> sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
>  8b32e7b2f7b12cf2aa60eb955f72db85afbe41cd 
>   
> sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestOwnerPrivilegesWithGrantOption.java
>  b3d98cb319916b2272c10ea0b39d91d4b118df3e 
> 
> 
> Diff: https://reviews.apache.org/r/68452/diff/3/
> 
> 
> Testing
> ---
> 
> Added new test to verify the same and also made sure that all the existing 
> tests passed.
> 
> 
> Thanks,
> 
> kalyan kumar kalvagadda
> 
>



Re: Review Request 68452: SENTRY-2359: Object owner is unable to grant privileges: SentryAccessDeniedException

2018-08-22 Thread kalyan kumar kalvagadda via Review Board

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68452/
---

(Updated Aug. 22, 2018, 10:40 a.m.)


Review request for sentry, Na Li and Sergio Pena.


Changes
---

fixed issue with previous patch.


Bugs: SENTRY-2359
https://issues.apache.org/jira/browse/SENTRY-2359


Repository: sentry


Description
---

Added code changes to look for owner privilege for roles and users while 
authorizing a privilege grant request.


Diffs (updated)
-

  
sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryPrivilege.java
 1decef2bafb98cdeb98f7d570eecdcc705f8249f 
  
sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
 8b32e7b2f7b12cf2aa60eb955f72db85afbe41cd 
  
sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestOwnerPrivilegesWithGrantOption.java
 b3d98cb319916b2272c10ea0b39d91d4b118df3e 


Diff: https://reviews.apache.org/r/68452/diff/3/

Changes: https://reviews.apache.org/r/68452/diff/2-3/


Testing
---

Added new test to verify the same and also made sure that all the existing 
tests passed.


Thanks,

kalyan kumar kalvagadda



Re: Review Request 68452: SENTRY-2359: Object owner is unable to grant privileges: SentryAccessDeniedException

2018-08-22 Thread kalyan kumar kalvagadda via Review Board

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68452/
---

(Updated Aug. 22, 2018, 7:15 a.m.)


Review request for sentry, Na Li and Sergio Pena.


Changes
---

addressed review comments.


Bugs: SENTRY-2359
https://issues.apache.org/jira/browse/SENTRY-2359


Repository: sentry


Description
---

Added code changes to look for owner privilege for roles and users while 
authorizing a privilege grant request.


Diffs (updated)
-

  
sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryPrivilege.java
 1decef2bafb98cdeb98f7d570eecdcc705f8249f 
  
sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
 8b32e7b2f7b12cf2aa60eb955f72db85afbe41cd 
  
sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestOwnerPrivilegesWithGrantOption.java
 b3d98cb319916b2272c10ea0b39d91d4b118df3e 
  
sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/AbstractTestWithStaticConfiguration.java
 8bf486e7d7d7a2e89278f1287115bf835513ef3f 
  
sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/hive/TestPolicyImportExport.java
 b048989b42bde0318c6d0fa0e9353a2a59954407 


Diff: https://reviews.apache.org/r/68452/diff/2/

Changes: https://reviews.apache.org/r/68452/diff/1-2/


Testing
---

Added new test to verify the same and also made sure that all the existing 
tests passed.


Thanks,

kalyan kumar kalvagadda



Re: Review Request 68452: SENTRY-2359: Object owner is unable to grant privileges: SentryAccessDeniedException

2018-08-21 Thread Na Li via Review Board

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68452/#review207728
---




sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestOwnerPrivilegesWithGrantOption.java
Lines 131 (patched)


The comment should be changed from "verify privileges is transferred to 
role owner_role" to "verify owner privilege is granted to user USER1_1". The 
statement is "CREATE TABLE" not "ALTER TABLE SET OWNER"



sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestOwnerPrivilegesWithGrantOption.java
Lines 138 (patched)


REMOVE empty line



sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestOwnerPrivilegesWithGrantOption.java
Lines 146 (patched)


what is the point of having this 
verifyTableOwnerPrivilegeExistForPrincipal? There is no owner transfer. We can 
remove this comment and code.



sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestOwnerPrivilegesWithGrantOption.java
Lines 152 (patched)


The comment should be change to "USER2_1 drop table"


- Na Li


On Aug. 21, 2018, 9:19 p.m., kalyan kumar kalvagadda wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68452/
> ---
> 
> (Updated Aug. 21, 2018, 9:19 p.m.)
> 
> 
> Review request for sentry, Na Li and Sergio Pena.
> 
> 
> Bugs: SENTRY-2359
> https://issues.apache.org/jira/browse/SENTRY-2359
> 
> 
> Repository: sentry
> 
> 
> Description
> ---
> 
> Added code changes to look for owner privilege for roles and users while 
> authorizing a privilege grant request.
> 
> 
> Diffs
> -
> 
>   
> sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/model/MSentryPrivilege.java
>  1decef2bafb98cdeb98f7d570eecdcc705f8249f 
>   
> sentry-service/sentry-service-server/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java
>  8b32e7b2f7b12cf2aa60eb955f72db85afbe41cd 
>   
> sentry-tests/sentry-tests-hive/src/test/java/org/apache/sentry/tests/e2e/dbprovider/TestOwnerPrivilegesWithGrantOption.java
>  b3d98cb319916b2272c10ea0b39d91d4b118df3e 
> 
> 
> Diff: https://reviews.apache.org/r/68452/diff/1/
> 
> 
> Testing
> ---
> 
> Added new test to verify the same and also made sure that all the existing 
> tests passed.
> 
> 
> Thanks,
> 
> kalyan kumar kalvagadda
> 
>