Example usage for org.apache.commons.lang.exception NestableRuntimeException NestableRuntimeException

List of usage examples for org.apache.commons.lang.exception NestableRuntimeException NestableRuntimeException

Introduction

In this page you can find the example usage for org.apache.commons.lang.exception NestableRuntimeException NestableRuntimeException.

Prototype

public NestableRuntimeException() 

Source Link

Document

Constructs a new NestableRuntimeException without specified detail message.

Usage

From source file:com.anite.antelope.modules.tools.SecurityTool.java

/**
 * This method checks if the logged in user the specified permission
 * //from w w  w.j  a  v  a  2s  .c  om
 * @param data the RunData object containing the logged in user
 * @param permission the Permission to check 
 * @return
 */
public boolean hasPermission(RunData data, Permission permission) {
    // Before doing anything else check that
    // the data contains a user
    if (isAnonUser(data)) {
        return false;
    }
    User user;
    try {
        user = getUserManager().getUser(data.getUser().getName());
    } catch (UnknownEntityException e) {
        throw new NestableRuntimeException();
    } catch (DataBackendException e) {
        throw new NestableRuntimeException();
    }
    return hasPermission(user, permission);
}

From source file:com.anite.antelope.modules.tools.SecurityTool.java

/**
 * //from   w ww . j a va 2 s  . c o  m
 * @param user
 * @param permission
 * @return
 */
public boolean hasPermission(User user, Permission permission) {
    DynamicAccessControlList dacl;
    try {
        dacl = (DynamicAccessControlList) getUserManager().getACL(user);
    } catch (UnknownEntityException e) {
        throw new NestableRuntimeException();
    }
    return dacl.hasPermission(permission);
}