javax.jcr.security.AccessControlException.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中javax.jcr.security.AccessControlException.<init>()方法的一些代码示例,展示了AccessControlException.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AccessControlException.<init>()方法的具体详情如下:
包路径:javax.jcr.security.AccessControlException
类名称:AccessControlException
方法名:<init>

AccessControlException.<init>介绍

[英]Constructs a new instance of this class with null as its detail message.
[中]构造此类的新实例,并将null作为其详细信息。

代码示例

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

/**
 * @see org.apache.jackrabbit.api.security.JackrabbitAccessControlList#addEntry(Principal, Privilege[], boolean)
 */
public boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow) throws AccessControlException {
  throw new AccessControlException("Unmodifiable ACL. Use AccessControlManager#getPolicy or #getApplicablePolicies in order to obtain an modifiable ACL.");
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

/**
 * @see org.apache.jackrabbit.api.security.JackrabbitAccessControlList#addEntry(Principal, Privilege[], boolean, Map)
 */
public boolean addEntry(Principal principal, Privilege[] privileges, boolean isAllow, Map<String, Value> restrictions) throws AccessControlException {
  throw new AccessControlException("Unmodifiable ACL. Use AccessControlManager#getPolicy or #getApplicablePolicies in order to obtain an modifiable ACL.");
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

/**
 * @see org.apache.jackrabbit.api.security.JackrabbitAccessControlList#orderBefore(AccessControlEntry, AccessControlEntry)
 */
public void orderBefore(AccessControlEntry srcEntry, AccessControlEntry destEntry) throws AccessControlException {
  throw new AccessControlException("Unmodifiable ACL. Use AccessControlManager#getPolicy or #getApplicablePolicy in order to obtain a modifiable ACL.");
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public boolean addEntry(Principal principal, Privilege[] privileges,
            boolean isAllow, Map<String, Value> restrictions) throws AccessControlException {
  throw new AccessControlException("Immutable ACL. Use AccessControlManager#getPolicy or #getApplicablePolicies in order to obtain an modifiable ACL.");
}

代码示例来源:origin: apache/jackrabbit

/**
 * @see AccessControlList#removeAccessControlEntry(AccessControlEntry)
 */
public void removeAccessControlEntry(AccessControlEntry ace)
    throws AccessControlException, RepositoryException {
  throw new AccessControlException("Unmodifiable ACL. Use AccessControlManager#getApplicablePolicies in order to obtain an modifiable ACL.");
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

/**
 * @see AccessControlList#addAccessControlEntry(Principal, Privilege[])
 */
public boolean addAccessControlEntry(Principal principal,
                   Privilege[] privileges)
    throws AccessControlException, RepositoryException {
  throw new AccessControlException("Unmodifiable ACL. Use AccessControlManager#getApplicablePolicies in order to obtain an modifiable ACL.");
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

/**
 * @see javax.jcr.security.AccessControlList#removeAccessControlEntry(AccessControlEntry)
 */
public void removeAccessControlEntry(AccessControlEntry ace)
    throws AccessControlException, RepositoryException {
  if (!(ace instanceof Entry)) {
    throw new AccessControlException("Invalid AccessControlEntry implementation " + ace.getClass().getName() + ".");
  }
  if (!entries.remove(ace)) {
    throw new AccessControlException("Cannot remove AccessControlEntry " + ace);
  }
}

代码示例来源:origin: apache/jackrabbit

@Override
public void removeAccessControlEntry(AccessControlEntry ace)
    throws AccessControlException, RepositoryException {
  if (entries.contains(ace)) {
    entries.remove(ace);
  } else {
    throw new AccessControlException("Entry not present in this list");
  }
}

代码示例来源:origin: apache/jackrabbit-oak

@NotNull
private String getOakName(@Nullable String jcrName) throws RepositoryException {
  if (jcrName == null) {
    throw new AccessControlException("Invalid privilege name 'null'");
  }
  String oakName = namePathMapper.getOakNameOrNull(jcrName);
  if (oakName == null) {
    throw new AccessControlException("Cannot resolve privilege name " + jcrName);
  }
  return oakName;
}

代码示例来源:origin: apache/jackrabbit-oak

@NotNull
@Override
public Restriction createRestriction(@Nullable String oakPath, @NotNull String oakName, @NotNull Value value) throws AccessControlException, RepositoryException {
  throw new AccessControlException("This implementation doesn't support any restrictions");
}

代码示例来源:origin: apache/jackrabbit-oak

@NotNull
@Override
public Restriction createRestriction(@Nullable String oakPath, @NotNull String oakName, @NotNull Value... values) throws AccessControlException, RepositoryException {
  throw new AccessControlException("This implementation doesn't support any restrictions");
}

代码示例来源:origin: apache/jackrabbit-oak

@NotNull
private RestrictionDefinition getDefinition(@Nullable String oakPath, @NotNull String oakName) throws AccessControlException {
  if (isUnsupportedPath(oakPath)) {
    throw new AccessControlException("Unsupported restriction at " + oakPath);
  }
  RestrictionDefinition definition = supported.get(oakName);
  if (definition == null) {
    throw new AccessControlException("Unsupported restriction: " + oakName);
  }
  return definition;
}

代码示例来源:origin: apache/jackrabbit-oak

static void checkValidPolicy(@Nullable String oakPath, @NotNull AccessControlPolicy policy) throws AccessControlException {
  if (!isValidPolicy(oakPath, policy)) {
    throw new AccessControlException("Invalid access control policy " + policy);
  }
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

/**
 * Always returns an empty array as no applicable policies are exposed.
 * 
 * @see AccessControlEditor#getPolicies(Principal)
 */
public JackrabbitAccessControlPolicy[] getPolicies(Principal principal) throws AccessControlException, RepositoryException {
  if (!session.getPrincipalManager().hasPrincipal(principal.getName())) {
    throw new AccessControlException("Unknown principal.");
  }
  // TODO: impl. missing
  return new JackrabbitAccessControlPolicy[0];
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

/**
 * @see AccessControlEditor#editAccessControlPolicies(Principal)
 */
public JackrabbitAccessControlPolicy[] editAccessControlPolicies(Principal principal) throws AccessDeniedException, AccessControlException, RepositoryException {
  if (!session.getPrincipalManager().hasPrincipal(principal.getName())) {
    throw new AccessControlException("Unknown principal.");
  }
  // TODO: impl. missing
  return new JackrabbitAccessControlPolicy[0];
}

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

/**
 * Always throws <code>AccessControlException</code>
 *
 * @see javax.jcr.security.AccessControlManager#setPolicy(String, AccessControlPolicy)
 */
public void setPolicy(String absPath, AccessControlPolicy policy) throws PathNotFoundException, AccessControlException, AccessDeniedException, RepositoryException {
  checkInitialized();
  checkPermission(absPath, Permission.MODIFY_AC);
  throw new AccessControlException("AccessControlPolicy " + policy + " cannot be applied.");
}

代码示例来源:origin: org.apache.jackrabbit/oak-core

@Override
public void setPolicy(String absPath, AccessControlPolicy policy) throws RepositoryException {
  for (AccessControlManager acMgr : acMgrs) {
    if (acMgr instanceof PolicyOwner && ((PolicyOwner) acMgr).defines(absPath, policy)) {
      acMgr.setPolicy(absPath, policy);
      return;
    }
  }
  throw new AccessControlException("Cannot set access control policy " + policy + "; no PolicyOwner found.");
}

代码示例来源:origin: apache/jackrabbit

@Override
public Privilege privilegeFromName(SessionInfo sessionInfo, NamePathResolver resolver, String privilegeName) throws RepositoryException {
  Name name = resolver.getQName(privilegeName);
  Privilege priv = getPrivilegeFromName(sessionInfo, resolver, name);
  
   if (priv == null) {
    throw new AccessControlException("Unknown privilege " + privilegeName);
  } else {
    return priv;
  }
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public void removePolicy(String absPath, AccessControlPolicy policy) throws RepositoryException {
  for (AccessControlManager acMgr : acMgrs) {
    if (acMgr instanceof PolicyOwner && ((PolicyOwner) acMgr).defines(absPath, policy)) {
      acMgr.removePolicy(absPath, policy);
      return;
    }
  }
  throw new AccessControlException("Cannot remove access control policy " + policy + "; no PolicyOwner found.");
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public Privilege getPrivilege(String privilegeName) throws RepositoryException {
  PrivilegeDefinition def = getPrivilegeDefinition(getOakName(privilegeName));
  if (def == null) {
    throw new AccessControlException("No such privilege " + privilegeName);
  } else {
    return getPrivilege(def);
  }
}

相关文章

AccessControlException类方法