Exemple #1
0
 /**
  * Set the boolean flags in the catalog group based on the given permissions. If a flag is set in
  * the catalog group but the corresponding permission is not present in the permissions set, the
  * flag will NOT be flipped.
  *
  * @param group The catalog group
  * @param permissions Permissions to set in the group
  */
 public static final void setPermissionsInGroup(Group group, EnumSet<Permission> permissions) {
   for (Permission p : permissions) {
     switch (p) {
       case ADMIN:
         group.setAdmin(true);
         break;
       case DEFAULTPROC:
         group.setDefaultproc(true);
         break;
       case DEFAULTPROCREAD:
         group.setDefaultprocread(true);
         break;
       case SQL:
         group.setSql(true);
         break;
       case SQLREAD:
         group.setSqlread(true);
         break;
       case ALLPROC:
         group.setAllproc(true);
         break;
     }
   }
 }