+package de.juplo.yourshouter;
+
+import java.util.List;
+import javax.inject.Inject;
+
+import org.springframework.social.facebook.api.Facebook;
+import org.springframework.social.facebook.api.Permission;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+
+/**
+ * Controller, that handles requests to the root of the application.
+ *
+ * @author Kai Moritz
+ */
+@Controller
+public class PermissionsController
+{
+ private final Facebook facebook;
+
+
+ @Inject
+ public PermissionsController(Facebook facebook)
+ {
+ this.facebook = facebook;
+ }
+
+
+ @RequestMapping(value = "/permissions.html", method = RequestMethod.GET)
+ public String list(Model model)
+ {
+ List<Permission> permissions = facebook.userOperations().getUserPermissions();
+ model.addAttribute("permissions", permissions);
+ return "permissions";
+ }
+}