Example usage for java.security Permissions implies

List of usage examples for java.security Permissions implies

Introduction

In this page you can find the example usage for java.security Permissions implies.

Prototype

@Override
public boolean implies(Permission permission) 

Source Link

Document

Checks to see if this object's PermissionCollection for permissions of the specified permission's class implies the permissions expressed in the permission object.

Usage

From source file:com.sun.socialsite.business.impl.JPAPermissionManagerImpl.java

/**
 * {@inheritDoc}/* w w  w  .j av  a 2 s.  c  o  m*/
 */
public void checkPermission(Permission requiredPermission, SecurityToken token) throws SocialSiteException {
    Permissions grantedPermissions = getPermissions(token);
    log.debug("requiredPermission=" + requiredPermission);
    log.debug("grantedPermissions=" + grantedPermissions);
    if (grantedPermissions.implies(requiredPermission) == false) {
        throw new SecurityException("Access Denied");
    }
}