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

com.icthh.xm.commons.permission.access.XmPermissionEvaluator Maven / Gradle / Ivy

There is a newer version: 4.0.20
Show newest version
package com.icthh.xm.commons.permission.access;

import com.icthh.xm.commons.permission.service.PermissionCheckService;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.PermissionEvaluator;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;

import java.io.Serializable;

@Component
@RequiredArgsConstructor
public class XmPermissionEvaluator implements PermissionEvaluator {

    private final PermissionCheckService service;

    @Override
    public boolean hasPermission(Authentication authentication, Object resource, Object privilege) {
        return service.hasPermission(authentication, resource, privilege);
    }

    @Override
    public boolean hasPermission(Authentication authentication, Serializable resource, String resourceType,
                                 Object privilege) {
        return service.hasPermission(authentication, resource, resourceType, privilege);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy