Java Code Examples for org.apache.atlas.AtlasErrorCode#UNAUTHORIZED_ACCESS

The following examples show how to use org.apache.atlas.AtlasErrorCode#UNAUTHORIZED_ACCESS . 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: AtlasAuthorizationUtils.java    From atlas with Apache License 2.0 5 votes vote down vote up
public static void verifyAccess(AtlasAdminAccessRequest request, Object... errorMsgParams) throws AtlasBaseException {
    if (! isAccessAllowed(request)) {
        String message = (errorMsgParams != null && errorMsgParams.length > 0) ? StringUtils.join(errorMsgParams) : "";

        throw new AtlasBaseException(AtlasErrorCode.UNAUTHORIZED_ACCESS, request.getUser(), message);
    }
}
 
Example 2
Source File: AtlasAuthorizationUtils.java    From atlas with Apache License 2.0 5 votes vote down vote up
public static void verifyAccess(AtlasTypeAccessRequest request, Object... errorMsgParams) throws AtlasBaseException {
    if (! isAccessAllowed(request)) {
        String message = (errorMsgParams != null && errorMsgParams.length > 0) ? StringUtils.join(errorMsgParams) : "";

        throw new AtlasBaseException(AtlasErrorCode.UNAUTHORIZED_ACCESS, request.getUser(), message);
    }
}
 
Example 3
Source File: AtlasAuthorizationUtils.java    From atlas with Apache License 2.0 5 votes vote down vote up
public static void verifyAccess(AtlasEntityAccessRequest request, Object... errorMsgParams) throws AtlasBaseException {
    if (! isAccessAllowed(request)) {
        String message = (errorMsgParams != null && errorMsgParams.length > 0) ? StringUtils.join(errorMsgParams) : "";

        throw new AtlasBaseException(AtlasErrorCode.UNAUTHORIZED_ACCESS, request.getUser(), message);
    }
}
 
Example 4
Source File: AtlasAuthorizationUtils.java    From atlas with Apache License 2.0 4 votes vote down vote up
public static void verifyAccess(AtlasRelationshipAccessRequest request, Object... errorMsgParams) throws AtlasBaseException {
    if (!isAccessAllowed(request)) {
        String message = (errorMsgParams != null && errorMsgParams.length > 0) ? StringUtils.join(errorMsgParams) : "";
        throw new AtlasBaseException(AtlasErrorCode.UNAUTHORIZED_ACCESS, request.getUser(), message);
    }
}