INNER CODE UNIT · Java

beforeRequireAnyRole

pac4j/spring-webmvc-pac4j · src/main/java/org/pac4j/springframework/annotation/RequireRoleAnnotationAspect.java:59

    public void beforeRequireAnyRole(final RequireAnyRole requireAnyRole) {
        val profiles = isAuthenticated();

        final RequireAnyRoleAuthorizer authorizer = new RequireAnyRoleAuthorizer(requireAnyRole.value());
        if (!authorizer.isAuthorized(webContext, sessionStore, profiles)) {
            throw new ForbiddenAction();
        }
    }

    /**
     * Check whether the user has all the roles.
     *
     * @param requireAllRoles the roles config
     */
    @Before("@annotation(requireAllRoles)")
    public void beforeRequireAllRoles(final RequireAllRoles requireAllRoles) {
        val profiles = isAuthenticated();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…