org.nuxeo.ecm.core.api.security.ACE.getStatus()方法的使用及代码示例

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

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

ACE.getStatus介绍

[英]Returns the status of this ACE.
[中]返回此ACE的状态。

代码示例

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

public boolean isEffective() {
  return getStatus() == Status.EFFECTIVE;
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

public boolean isPending() {
  return getStatus() == Status.PENDING;
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

public boolean isArchived() {
  return getStatus() == Status.ARCHIVED;
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-api

/**
 * Returns a Long value of this ACE status.
 * <p>
 * It returns {@code null} if there is no begin and end date, which means the ACE is effective. Otherwise, it
 * returns 0 for PENDING, 1 for EFFECTIVE and 2 for ARCHIVED.
 *
 * @since 7.4
 */
public Long getLongStatus() {
  if (begin == null && end == null) {
    return null;
  }
  return Long.valueOf(getStatus().ordinal());
}

代码示例来源:origin: org.nuxeo.ecm.core/nuxeo-core-io

@Override
protected void writeEntityBody(ACP acp, JsonGenerator jg) throws IOException {
  jg.writeArrayFieldStart("acl");
  for (ACL acl : acp.getACLs()) {
    jg.writeStartObject();
    jg.writeStringField("name", acl.getName());
    jg.writeArrayFieldStart("ace");
    for (ACE ace : acl.getACEs()) {
      jg.writeStartObject();
      jg.writeStringField("id", ace.getId());
      jg.writeStringField("username", ace.getUsername());
      jg.writeStringField("permission", ace.getPermission());
      jg.writeBooleanField("granted", ace.isGranted());
      jg.writeStringField("creator", ace.getCreator());
      jg.writeStringField("begin",
          ace.getBegin() != null ? DateParser.formatW3CDateTime(ace.getBegin().getTime()) : null);
      jg.writeStringField("end", ace.getEnd() != null ? DateParser.formatW3CDateTime(ace.getEnd().getTime())
          : null);
      jg.writeStringField("status", ace.getStatus().toString().toLowerCase());
      jg.writeEndObject();
    }
    jg.writeEndArray();
    jg.writeEndObject();
  }
  jg.writeEndArray();
}

相关文章