Exemplo n.º 1
0
 @Override
 public Site getDefaultSite() throws IllegalStateException {
   Site site = siteService.getDefaultSite();
   if (site != null) {
     if (!userCredentials
         .getAssignments()
         .hasPermission(Permission.Guest, Subject.Site, new Reference(site.getId()))) {
       throw new PermissionException("You cannot show this site");
     }
   }
   return site;
 }
Exemplo n.º 2
0
 protected void checkSuperAdmin() {
   if (!userCredentials.getAssignments().isSuperAdministrateur()) {
     throw new PermissionException("Only super Administrator can do this");
   }
 }