Search in sources :

Example 1 with DelegatePermissionCollection

use of org.apache.openejb.assembler.classic.DelegatePermissionCollection in project tomee by apache.

the class BasicPolicyConfiguration method addToRole.

public void addToRole(final String roleName, final Permission permission) throws PolicyContextException {
    if (state != OPEN) {
        throw new UnsupportedOperationException("Not in an open state");
    }
    PermissionCollection permissions = rolePermissionsMap.get(roleName);
    if (permissions == null) {
        permissions = new DelegatePermissionCollection();
        rolePermissionsMap.put(roleName, permissions);
    }
    permissions.add(permission);
}
Also used : DelegatePermissionCollection(org.apache.openejb.assembler.classic.DelegatePermissionCollection) PermissionCollection(java.security.PermissionCollection) DelegatePermissionCollection(org.apache.openejb.assembler.classic.DelegatePermissionCollection)

Aggregations

PermissionCollection (java.security.PermissionCollection)1 DelegatePermissionCollection (org.apache.openejb.assembler.classic.DelegatePermissionCollection)1