com.github.iintelligas.controller.PermissionController Maven / Gradle / Ivy
The newest version!
package com.github.iintelligas.controller;
import com.github.iintelligas.persist.dto.Permission;
import com.github.iintelligas.service.PermissionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
@Controller
public class PermissionController
{
private static final Logger logger = LoggerFactory.getLogger(PermissionController.class);
private final PermissionService permissionService;
@Autowired
public PermissionController(PermissionService permissionService) {
this.permissionService = permissionService;
}
@GetMapping("/profile-permission-list")
public String landing(Model model)
{
if(logger.isDebugEnabled())
{
logger.debug("Inside PermissionController.landing()");
}
populatePermissions(model);
return "profile/profile-permission-list";
}
private void populatePermissions(Model model) {
List permissions = permissionService.getPermissions();
model.addAttribute("permissions", permissions);
}
}