コード例 #1
0
 private boolean shouldDecorateResource(Resource resource) {
   if (isProject(resource)) {
     Project project = (Project) resource;
     return project.getId() != null && countRoles(project.getId()) == 0;
   }
   return false;
 }
コード例 #2
0
 public void decorate(Resource resource, DecoratorContext context) {
   if (shouldDecorateResource(resource)) {
     Project project = (Project) resource;
     roleManager.affectDefaultRolesToResource(project.getId());
   }
 }