Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a new condition to identify when a everyone deny is found and … #677

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

pcastelog
Copy link

The change is going to find an everyone deny at the bottom of the list and if that is the case, loops again the entire permissions on the node removing the permission in the configuration files to apply them again on top.

…if that is the case, all configured acls on the node are removed and installed again
// usually happens when SP installs some rep:policy nodes
if ((acl.size() - countOutsideConfig <= configuredAceEntries.size())
&& (StringUtils.startsWith(actualAceBeanCompareStr, "everyone") && StringUtils.contains(actualAceBeanCompareStr, "deny"))) {
everyoneDenyFound = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test case for that condition?

@@ -97,6 +98,12 @@ protected void installAcl(Set<AceBean> aceBeanSetFromConfig, String path, Set<St
if (!principalsInConfiguration.contains(acePrincipalName)) {
countOutsideConfig++;
diffLog.append(" OUTSIDE (not in Config) " + actualAceBeanCompareStr + "\n");
// Condition will check if everyone deny was added at the bottom, blocking all permissions created by actool
// usually happens when SP installs some rep:policy nodes
if ((acl.size() - countOutsideConfig <= configuredAceEntries.size())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this condition checks the position of the everyone deny (what is stated in the comment), or is everyoneDenyFound always true irrespective of the position of the deny for everyone?

// Condition will check if everyone deny was added at the bottom, blocking all permissions created by actool
// usually happens when SP installs some rep:policy nodes
if ((acl.size() - countOutsideConfig <= configuredAceEntries.size())
&& (StringUtils.startsWith(actualAceBeanCompareStr, "everyone") && StringUtils.contains(actualAceBeanCompareStr, "deny"))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please act on actualAceBean instead of the string serialization for those checks

@@ -134,6 +141,18 @@ protected void installAcl(Set<AceBean> aceBeanSetFromConfig, String path, Set<St

}

// will override the logic to apply all ACLs on the path, and removing all elements present in config files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it make more sense that instead of reapplying everything just reorder the deny?

@kwin
Copy link
Member

kwin commented Oct 26, 2023

Please also add a reference to #676 in the commit message to autolink it.

@kwin kwin requested a review from ghenzler October 26, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants