package com.itdominator.api.controller;


import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;



@RestController
@EnableMethodSecurity(securedEnabled = true, prePostEnabled = true)
@RequiredArgsConstructor
@Slf4j
@Validated
public class BaseController {


    @PreAuthorize("hasRole('User')")
    // @PreAuthorize("hashPermission('User')")
    @GetMapping("/")
    public String root() {
        return "<h1>Hello, World!</h1>";
    }

}
