package com.hepl.tunefortwo.config.security;

import java.util.Map;

import org.springframework.security.access.expression.method.MethodSecurityExpressionOperations;
import org.springframework.stereotype.Component;

@Component("authz")
public class CustomAuthorization {

    private final JWTHelper jwtHelper;

    public CustomAuthorization(JWTHelper jwtHelper) {
        this.jwtHelper = jwtHelper;
    }

    public boolean decide(MethodSecurityExpressionOperations operations, String scope) {
        Map<String, Object> userDetails = jwtHelper.getDetails(operations.getAuthentication());
        return true;
    }

}
