Java Code Examples for java.security.acl.AclEntry#checkPermission()

The following examples show how to use java.security.acl.AclEntry#checkPermission() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AclImpl.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 2
Source File: AclImpl.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 3
Source File: AclImpl.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 4
Source File: AclImpl.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 5
Source File: AclImpl.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 6
Source File: AclImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 7
Source File: AclImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 8
Source File: AclImpl.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 9
Source File: AclImpl.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 10
Source File: AclImpl.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 11
Source File: AclImpl.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 12
Source File: AclImpl.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 13
Source File: AclImpl.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}
 
Example 14
Source File: AclImpl.java    From jdk8u-dev-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Checks whether or not the specified principal has the specified
 * permission.
 * If it does, true is returned, otherwise false is returned.
 * More specifically, this method checks whether the passed permission
 * is a member of the allowed permission set of the specified principal.
 * The allowed permission set is determined by the same algorithm as is
 * used by the getPermissions method.
 *
 * @param user the principal, assumed to be a valid authenticated Principal.
 * @param perm the permission to be checked for.
 * @return true if the principal has the specified permission,
 *         false otherwise.
 * @see java.security.Principal
 * @see java.security.Permission
 */
@Override
public boolean checkPermission(Principal user,
                               java.security.acl.Permission perm) {
      for (Enumeration<AclEntry> e = entryList.elements();e.hasMoreElements();){
        AclEntry ent = e.nextElement();
        if (ent.getPrincipal().equals(user))
              if (ent.checkPermission(perm)) return true;
      }
      return false;
}