java.security.BasicPermission.implies()方法的使用及代码示例

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

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

BasicPermission.implies介绍

[英]Checks if the specified permission is "implied" by this object.

More specifically, this method returns true if:

  • p's class is the same as this object's class, and
  • p's name equals or (in the case of wildcards) is implied by this object's name. For example, "a.b.*" implies "a.b.c".
    [中]检查指定的权限是否由该对象“暗示”。
    更具体地说,此方法在以下情况下返回true:
    *p的类与该对象的类相同,并且
    p的名称等于或(在通配符的情况下)由该对象的名称暗示。例如,“a.b.”意味着“a.b.c”。

代码示例

代码示例来源:origin: wildfly/wildfly

public boolean implies(final SelectorPermission p) {
  return p != null && (p.actions & actions) == p.actions && super.implies(p);
}

代码示例来源:origin: org.osgi/org.osgi.core

/**
 * Internal implies method. Used by the implies and the permission
 * collection implies methods.
 * 
 * @param requested The requested CapabilityPermission which has already be
 *        validated as a proper argument. The requested CapabilityPermission
 *        must not have a filter expression.
 * @param effective The effective actions with which to start.
 * @return {@code true} if the specified permission is implied by this
 *         object; {@code false} otherwise.
 */
boolean implies0(CapabilityPermission requested, int effective) {
  /* check actions first - much faster */
  effective |= action_mask;
  final int desired = requested.action_mask;
  if ((effective & desired) != desired) {
    return false;
  }
  /* Get filter if any */
  Filter f = filter;
  if (f == null) {
    return super.implies(requested);
  }
  return f.matches(requested.getProperties());
}

代码示例来源:origin: org.osgi/org.osgi.core

/**
 * Internal implies method. Used by the implies and the permission
 * collection implies methods.
 * 
 * @param requested The requested PackagePermission which has already be
 *        validated as a proper argument. The requested PackagePermission
 *        must not have a filter expression.
 * @param effective The effective actions with which to start.
 * @return {@code true} if the specified permission is implied by this
 *         object; {@code false} otherwise.
 */
boolean implies0(PackagePermission requested, int effective) {
  /* check actions first - much faster */
  effective |= action_mask;
  final int desired = requested.action_mask;
  if ((effective & desired) != desired) {
    return false;
  }
  /* Get filter if any */
  Filter f = filter;
  if (f == null) {
    return super.implies(requested);
  }
  return f.matches(requested.getProperties());
}

代码示例来源:origin: org.osgi/org.osgi.core

return ((effective & desired) == desired) && super.implies(requested);

代码示例来源:origin: org.osgi/org.osgi.core

return super.implies(requested);

代码示例来源:origin: org.osgi/org.osgi.compendium

/**
 * Checks if this {@code WirePermission} object {@code implies} the
 * specified permission.
 * <P>
 * More specifically, this method returns {@code true} if:
 * <p>
 * <ul>
 * <li><i>p</i> is an instanceof the {@code WirePermission} class,</li>
 * <li><i>p</i>'s actions are a proper subset of this object's actions, and</li>
 * <li><i>p</i>'s name is implied by this object's name. For example,
 * {@code java.*} implies {@code java.home}.</li>
 * </ul>
 * 
 * @param p The permission to check against.
 * 
 * @return {@code true} if the specified permission is implied by this
 *         object; {@code false} otherwise.
 */
public boolean implies(Permission p) {
  if (p instanceof WirePermission) {
    WirePermission requested = (WirePermission) p;
    int requestedMask = requested.getActionsMask();
    return ((getActionsMask() & requestedMask) == requestedMask) && super.implies(p);
  }
  return false;
}

代码示例来源:origin: org.osgi/org.osgi.compendium

super.implies(p);

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
public boolean implies(Permission p) {
  // check for a special value of STANDARD to imply the basic set
  if (p != null && p.getClass() == getClass()) {
    ClassPermission other = (ClassPermission) p;
    if (STANDARD.equals(getName()) && STANDARD_CLASSES.contains(other.getName())) {
      return true;
    }
  }
  return super.implies(p);
}

代码示例来源:origin: org.apache.felix/org.osgi.compendium

/**
 * Checks if this <code>WirePermission</code> object <code>implies</code>
 * the specified permission.
 * <P>
 * More specifically, this method returns <code>true</code> if:
 * <p>
 * <ul>
 * <li><i>p </i> is an instanceof the <code>WirePermission</code> class,
 * <li><i>p </i>'s actions are a proper subset of this object's actions, and
 * <li><i>p </i>'s name is implied by this object's name. For example,
 * <code>java.*</code> implies <code>java.home</code>.
 * </ul>
 * 
 * @param p The permission to check against.
 * 
 * @return <code>true</code> if the specified permission is implied by this
 *         object; <code>false</code> otherwise.
 */
public boolean implies(Permission p) {
  if (p instanceof WirePermission) {
    WirePermission requested = (WirePermission) p;
    int requestedMask = requested.getActionsMask();
    return ((getActionsMask() & requestedMask) == requestedMask)
        && super.implies(p);
  }
  return false;
}

代码示例来源:origin: org.apache.felix/org.osgi.compendium

super.implies(p);

代码示例来源:origin: org.jboss.eap/wildfly-client-all

public boolean implies(final SelectorPermission p) {
  return p != null && (p.actions & actions) == p.actions && super.implies(p);
}

代码示例来源:origin: org.wildfly.common/wildfly-common

public boolean implies(final SelectorPermission p) {
  return p != null && (p.actions & actions) == p.actions && super.implies(p);
}

代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main

/**
 * Determines if a <code>ServicePermission</code> object "implies" the
 * specified permission.
 * 
 * @param p The target permission to check.
 * @return <code>true</code> if the specified permission is implied by
 *         this object; <code>false</code> otherwise.
 */
public boolean implies(Permission p) {
  if (p instanceof ServicePermission) {
    ServicePermission target = (ServicePermission) p;
    return (((action_mask & target.action_mask) == target.action_mask) && super
        .implies(p));
  }
  return (false);
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

@Override
public boolean implies(Permission p) {
  // check for a special value of STANDARD to imply the basic set
  if (p != null && p.getClass() == getClass()) {
    ClassPermission other = (ClassPermission) p;
    if (STANDARD.equals(getName()) && STANDARD_CLASSES.contains(other.getName())) {
      return true;
    }
  }
  return super.implies(p);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
public boolean implies(Permission p) {
  // check for a special value of STANDARD to imply the basic set
  if (p != null && p.getClass() == getClass()) {
    ClassPermission other = (ClassPermission) p;
    if (STANDARD.equals(getName()) && STANDARD_CLASSES.contains(other.getName())) {
      return true;
    }
  }
  return super.implies(p);
}

代码示例来源:origin: org.codelibs/elasticsearch-querybuilders

@Override
public boolean implies(Permission p) {
  // check for a special value of STANDARD to imply the basic set
  if (p != null && p.getClass() == getClass()) {
    ClassPermission other = (ClassPermission) p;
    if (STANDARD.equals(getName()) && STANDARD_CLASSES.contains(other.getName())) {
      return true;
    }
  }
  return super.implies(p);
}

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

@Override
public boolean implies(Permission p) {
  // check for a special value of STANDARD to imply the basic set
  if (p != null && p.getClass() == getClass()) {
    ClassPermission other = (ClassPermission) p;
    if (STANDARD.equals(getName()) && STANDARD_CLASSES.contains(other.getName())) {
      return true;
    }
  }
  return super.implies(p);
}

代码示例来源:origin: harbby/presto-connectors

@Override
public boolean implies(Permission p) {
  // check for a special value of STANDARD to imply the basic set
  if (p != null && p.getClass() == getClass()) {
    ClassPermission other = (ClassPermission) p;
    if (STANDARD.equals(getName()) && STANDARD_CLASSES.contains(other.getName())) {
      return true;
    }
  }
  return super.implies(p);
}

代码示例来源:origin: io.snappydata/gemfirexd-core

/**
 * Does this permission imply another. Only true
 * if the other permission is a SystemPermission
 * with the same name and all the actions
 * of the permission are present in this.
 * Note that none of the actions imply any other
 * with this SystemPermission.
 */
public boolean implies(Permission permission)
{
  if (!super.implies(permission))
    return false;
  
  int myActionMask = getActionMask(getActions());
  int permissionMask = getActionMask(permission.getActions());
  
  return
    (myActionMask & permissionMask) == permissionMask;
}

代码示例来源:origin: io.snappydata/gemfirexd

/**
 * Does this permission imply another. Only true
 * if the other permission is a SystemPermission
 * with the same name and all the actions
 * of the permission are present in this.
 * Note that none of the actions imply any other
 * with this SystemPermission.
 */
public boolean implies(Permission permission)
{
  if (!super.implies(permission))
    return false;
  
  int myActionMask = getActionMask(getActions());
  int permissionMask = getActionMask(permission.getActions());
  
  return
    (myActionMask & permissionMask) == permissionMask;
}

相关文章

微信公众号

最新文章

更多