[jira] [Commented] (RANGER-3752) Restrict duplicate access types entries in policy creation

2022-05-11 Thread kirby zhou (Jira)


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

kirby zhou commented on RANGER-3752:


It is not a good idea to modify the input parameters in the is method whose 
name implies read-only.

And this patch seems not be reviewed.

> Restrict duplicate access types entries in policy creation
> --
>
> Key: RANGER-3752
> URL: https://issues.apache.org/jira/browse/RANGER-3752
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Pradeep Agrawal
>Assignee: Pradeep Agrawal
>Priority: Major
> Fix For: 3.0.0
>
> Attachments: 
> 0001-RANGER-3752-Restrict-duplicate-access-types-entries-.patch
>
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)


[jira] [Commented] (RANGER-3752) Restrict duplicate access types entries in policy creation

2022-05-11 Thread Pradeep Agrawal (Jira)


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

Pradeep Agrawal commented on RANGER-3752:
-

[~kirbyzhou] : I don't understand what are you saying. Did you understand the 
issue ? 

Review link which has been reviewed : [https://reviews.apache.org/r/73981/]

 

> Restrict duplicate access types entries in policy creation
> --
>
> Key: RANGER-3752
> URL: https://issues.apache.org/jira/browse/RANGER-3752
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Pradeep Agrawal
>Assignee: Pradeep Agrawal
>Priority: Major
> Fix For: 3.0.0
>
> Attachments: 
> 0001-RANGER-3752-Restrict-duplicate-access-types-entries-.patch
>
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)


[jira] [Commented] (RANGER-3752) Restrict duplicate access types entries in policy creation

2022-05-11 Thread kirby zhou (Jira)


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

kirby zhou commented on RANGER-3752:


I understand the issue and what the code to do, Your solution is filter out 
duplicate at validation stage.

But the function name "isValidItemAccesses" strongly implies that it has no 
side effects. This makes it more difficult for future developer to understand 
the code.

My suggestion is to either change the name of the function or use your policy-2 
"if there are any duplicate entries then fail the policy request."

 

> Restrict duplicate access types entries in policy creation
> --
>
> Key: RANGER-3752
> URL: https://issues.apache.org/jira/browse/RANGER-3752
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Pradeep Agrawal
>Assignee: Pradeep Agrawal
>Priority: Major
> Fix For: 3.0.0
>
> Attachments: 
> 0001-RANGER-3752-Restrict-duplicate-access-types-entries-.patch
>
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)


[jira] [Commented] (RANGER-3752) Restrict duplicate access types entries in policy creation

2022-05-11 Thread kirby zhou (Jira)


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

kirby zhou commented on RANGER-3752:


Besides, I'm sorry I didn't notice the link to code review.

> Restrict duplicate access types entries in policy creation
> --
>
> Key: RANGER-3752
> URL: https://issues.apache.org/jira/browse/RANGER-3752
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Pradeep Agrawal
>Assignee: Pradeep Agrawal
>Priority: Major
> Fix For: 3.0.0
>
> Attachments: 
> 0001-RANGER-3752-Restrict-duplicate-access-types-entries-.patch
>
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)


[jira] [Commented] (RANGER-3752) Restrict duplicate access types entries in policy creation

2022-05-12 Thread kirby zhou (Jira)


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

kirby zhou commented on RANGER-3752:


This seems to be a historical problem, because the underlying 
"isValidPolicyItemAccess" function will also modify the input.
{code:java}
String matchedAccessType = getMatchedAccessType(accessType, accessTypes);
if (StringUtils.isEmpty(matchedAccessType)) {
//...
} else {
access.setType(matchedAccessType);
} {code}

> Restrict duplicate access types entries in policy creation
> --
>
> Key: RANGER-3752
> URL: https://issues.apache.org/jira/browse/RANGER-3752
> Project: Ranger
>  Issue Type: Bug
>  Components: Ranger
>Reporter: Pradeep Agrawal
>Assignee: Pradeep Agrawal
>Priority: Major
> Fix For: 3.0.0
>
> Attachments: 
> 0001-RANGER-3752-Restrict-duplicate-access-types-entries-.patch
>
>




--
This message was sent by Atlassian Jira
(v8.20.7#820007)