org.springframework.security.acls.model.Acl.getParentAcl()方法的使用及代码示例

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

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

Acl.getParentAcl介绍

[英]A domain object may have a parent for the purpose of ACL inheritance. If there is a parent, its ACL can be accessed via this method. In turn, the parent's parent (grandparent) can be accessed and so on.

This method solely represents the presence of a navigation hierarchy between the parent Acl and this Acl. For actual inheritance to take place, the #isEntriesInheriting() must also be true.

This method must operate correctly even if the Acl only represents a subset of Sids. The caller is responsible for correctly handling the result if only a subset of Sids is represented.
[中]出于ACL继承的目的,域对象可能具有父对象。如果存在父级,则可以通过此方法访问其ACL。反过来,可以访问父母的父母(祖父母)等等。
此方法仅表示父Acl和此Acl之间存在导航层次结构。要进行实际继承,#isEntriesInheriting()也必须为true。
即使Acl仅代表SID的一个子集,此方法也必须正确运行。如果只表示SID的子集,则调用方负责正确处理结果。

代码示例

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

public Object generateAllAceResponses(Acl acl) {
  List<AccessEntryResponse> result = new ArrayList<AccessEntryResponse>();
  while (acl != null) {
    for (AccessControlEntry ace : acl.getEntries()) {
      result.add(new AccessEntryResponse(ace.getId(), ace.getSid(), ace.getPermission(), ace.isGranting()));
    }
    acl = acl.getParentAcl();
  }
  return result;
}

代码示例来源:origin: spring-projects/spring-security

if (acl.isEntriesInheriting() && (acl.getParentAcl() != null)) {
  return acl.getParentAcl().isGranted(permission, sids, false);

代码示例来源:origin: spring-projects/spring-security

assertThat(childAcl.getParentAcl().getObjectIdentity()).isEqualTo(getMiddleParentOid());

代码示例来源:origin: codeabovelab/haven-platform

public Builder from(Acl aclData) {
  if(aclData instanceof MutableAcl) {
    this.setId((Long)((MutableAcl) aclData).getId());
  }
  final List<AccessControlEntry> srcEntries = aclData.getEntries();
  if(srcEntries != null) {
    final int size = srcEntries.size();
    final List<AceData> aceDatas = new ArrayList<>(size);
    for(int i = 0; i < size; ++i) {
      AccessControlEntry entry = srcEntries.get(i);
      AceData aceData = AceDataImpl.builder().from(entry).build();
      aceDatas.add(aceData);
    }
    this.setEntries(aceDatas);
  }
  this.setObjectIdentity(aclData.getObjectIdentity());
  this.setOwner(aclData.getOwner());
  Acl parentAcl = aclData.getParentAcl();
  if(parentAcl != null) {
    this.setParentAclData(AclDataImpl.builder().from(parentAcl).build());
  }
  this.setEntriesInheriting(aclData.isEntriesInheriting());
  return this;
}

代码示例来源:origin: org.molgenis/molgenis-security

if (acl.isEntriesInheriting() && (acl.getParentAcl() != null)) {
 return acl.getParentAcl().isGranted(permission, sids, false);
} else {

代码示例来源:origin: apache/servicemix-bundles

if (acl.isEntriesInheriting() && (acl.getParentAcl() != null)) {
  return acl.getParentAcl().isGranted(permission, sids, false);

相关文章