private CompiledPermissions getCompiledPermissions() { CompiledPermissions cp = compiledPermissions; if (cp == null) { if (PermissionUtil.isAdminOrSystem(principals, options)) { cp = AllPermissions.getInstance(); } else { cp = CompiledPermissionImpl.create(immutableRoot, workspaceName, getPermissionStore(immutableRoot, workspaceName, restrictionProvider), principals, options, ctx, providerCtx); } compiledPermissions = cp; } return cp; }
private CompiledPermissions getCompiledPermissions() { CompiledPermissions cp = compiledPermissions; if (cp == null) { if (PermissionUtil.isAdminOrSystem(principals, options)) { cp = AllPermissions.getInstance(); } else { cp = CompiledPermissionImpl.create(immutableRoot, workspaceName, getPermissionStore(immutableRoot, workspaceName, restrictionProvider), principals, options, ctx, providerCtx); } compiledPermissions = cp; } return cp; }
private CompiledPermissions getCompiledPermissions() { CompiledPermissions cp = compiledPermissions; if (cp == null) { if (PermissionUtil.isAdminOrSystem(principals, options)) { cp = AllPermissions.getInstance(); } else { cp = CompiledPermissionImpl.create(immutableRoot, workspaceName, getPermissionStore(immutableRoot, workspaceName, restrictionProvider), principals, restrictionProvider, options, ctx); } compiledPermissions = cp; } return cp; }
@Override boolean checkValidPrincipal(Principal principal) throws AccessControlException { int importBehavior = Util.getImportBehavior(getConfig()); if (!Util.checkValidPrincipal(principal, principalManager, importBehavior)) { return false; } if (PermissionUtil.isAdminOrSystem(ImmutableSet.of(principal), configParams)) { log.warn("Attempt to create an ACE for an administrative principal which always has full access:" + getPath()); switch (Util.getImportBehavior(getConfig())) { case ImportBehavior.ABORT: throw new AccessControlException("Attempt to create an ACE for an administrative principal which always has full access."); case ImportBehavior.IGNORE: return false; case ImportBehavior.BESTEFFORT: // just log warning, no other action required. break; default : throw new IllegalArgumentException("Invalid import behavior" + importBehavior); } } return true; }
@Override boolean checkValidPrincipal(Principal principal) throws AccessControlException { int importBehavior = Util.getImportBehavior(getConfig()); if (!Util.checkValidPrincipal(principal, principalManager, importBehavior)) { return false; } if (PermissionUtil.isAdminOrSystem(ImmutableSet.of(principal), configParams)) { log.warn("Attempt to create an ACE for an administrative principal which always has full access:" + getPath()); switch (Util.getImportBehavior(getConfig())) { case ImportBehavior.ABORT: throw new AccessControlException("Attempt to create an ACE for an administrative principal which always has full access."); case ImportBehavior.IGNORE: return false; case ImportBehavior.BESTEFFORT: // just log warning, no other action required. break; default : throw new IllegalArgumentException("Invalid import behavior" + importBehavior); } } return true; }
@Override boolean checkValidPrincipal(Principal principal) throws AccessControlException { int importBehavior = Util.getImportBehavior(getConfig()); if (!Util.checkValidPrincipal(principal, principalManager, importBehavior)) { return false; } if (PermissionUtil.isAdminOrSystem(ImmutableSet.of(principal), configParams)) { log.warn("Attempt to create an ACE for an administrative principal which always has full access:" + getPath()); switch (Util.getImportBehavior(getConfig())) { case ImportBehavior.ABORT: throw new AccessControlException("Attempt to create an ACE for an administrative principal which always has full access."); case ImportBehavior.IGNORE: return false; case ImportBehavior.BESTEFFORT: // just log warning, no other action required. break; default : throw new IllegalArgumentException("Invalid import behavior" + importBehavior); } } return true; }