All Downloads are FREE. Search and download functionalities are using the official Maven repository.

restx.security.Permission Maven / Gradle / Ivy

There is a newer version: 1.2.0-rc2
Show newest version
package restx.security;

import com.google.common.base.Optional;

import java.util.Map;

/**
 * A permission is a generic security concept, used to check if a principal is allowed to access a resource.
 */
public interface Permission {
    /**
     * Return absent if the permission is not met, or the matching permission if met.
     *
     * The returned permission is not always the same as this permission, in case of compound permissions it may be
     * more specific.
     *
     * @param principal the principal to check
     * @param roleInterpolationMap a role interpolation map which may be used to interpolate 'dynamic' roles
     * @return absent if not matched, the matching permission otherwise.
     */
    Optional has(RestxPrincipal principal, Map roleInterpolationMap);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy