Example #1
0
 private void addNewPermissionWithGroup(
     PermissionContainer container, Permission.AccessLevel acceassLevel, String groupKey) {
   Category userGroups = getSuperCategory().getCategory(Permission.GROUP_CATEGORY_KEY);
   Category group = userGroups.getCategory(groupKey);
   Permission permission = container.newPermission();
   permission.setAccessLevel(acceassLevel);
   permission.setGroup(group);
   container.addPermission(permission);
 }
 protected void printPermission(Permission p) throws IOException, RaplaException {
   openTag("rapla:permission");
   if (p.getUser() != null) {
     att("user", getId(p.getUser()));
   } else if (p.getGroup() != null) {
     if (isIdOnly()) {
       att("groupidref", getId(p.getGroup()));
     } else {
       att("group", getGroupPath(p.getGroup()));
     }
   }
   if (p.getMinAdvance() != null) {
     att("min-advance", p.getMinAdvance().toString());
   }
   if (p.getMaxAdvance() != null) {
     att("max-advance", p.getMaxAdvance().toString());
   }
   if (p.getStart() != null) {
     att("start-date", dateTimeFormat.formatDate(p.getStart()));
   }
   if (p.getEnd() != null) {
     att("end-date", dateTimeFormat.formatDate(p.getEnd()));
   }
   if (p.getAccessLevel() != Permission.ALLOCATE_CONFLICTS) {
     att("access", (String) Permission.ACCESS_LEVEL_NAMEMAP.get(p.getAccessLevel()));
   }
   closeElementTag();
 }