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

angela commented on OAK-6105:
-----------------------------

suggested improvement (as original present in patch for OAK-6072)

{code}
if (ImportBehavior.BESTEFFORT != importBehavior) {
                Authorizable member = 
getUserManager().getAuthorizable(memberId);
                String msg = null;
                if (member == null) {
                    msg = "Attempt to add or remove a non-existing member '" + 
memberId + "' with ImportBehavior = " + 
ImportBehavior.nameFromValue(importBehavior);
                } else if (member.isGroup()) {
                    if (((AuthorizableImpl) member).isEveryone()) {
                        msg = "Attempt to add everyone group as member.";
                    } else if (isCyclicMembership((Group) member)) {
                        msg = "Cyclic group membership detected for group " + 
getID() + " and member " + member.getID();
                    }
                }
                if (msg != null) {
                    if (ImportBehavior.ABORT == importBehavior) {
                        throw new ConstraintViolationException(msg);
                    } else {
                        // ImportBehavior.IGNORE is default in 
UserUtil.getImportBehavior
                        log.debug(msg);
                        continue;
                    }
                }
            }
{code}

> Respect ImportBehavior when trying to add 'Everyone' as member to another 
> group
> -------------------------------------------------------------------------------
>
>                 Key: OAK-6105
>                 URL: https://issues.apache.org/jira/browse/OAK-6105
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: angela
>            Priority: Trivial
>
> {{GroupImpl.updateMembers}} performs some validation of the new members to be 
> added. Depending on the configured {{ImportBehavior}} the validation skips 
> the resolution of memberIds (besteffort) or throws/ignores when a violation 
> is spotted.
> However, this {{ImportBehavior}} is not applied when the memberid is resolved 
> to the special everyone group. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to