Changeset 7215


Ignore:
Timestamp:
Oct 19, 2016, 3:47:52 PM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2034: New permission for annotating items

Added "Annotation" to permission filter used for filtering list pages. Made the list "smarter" by excluding permissions that are not defined for an item.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/ColumnDef.java

    r7116 r7215  
    745745              sb.append("<option value=\"\">");
    746746              Permission permission = context.getItemPermission();
     747              Set<Permission> definedPermission = context.getItemType().getDefinedPermissions();
    747748              hasFilter = permission != null;
    748749              appendPermissionOption(sb, permission, Permission.READ, "Read [R]");
    749               appendPermissionOption(sb, permission, Permission.USE, "Use [U]");
    750               appendPermissionOption(sb, permission, Permission.WRITE, "Write [W]");
    751               appendPermissionOption(sb, permission, Permission.DELETE, "Delete [D]");
    752               appendPermissionOption(sb, permission, Permission.SET_OWNER, "Change owner [O]");
    753               appendPermissionOption(sb, permission, Permission.SET_PERMISSION, "Change permissions [P]");
     750              if (definedPermission.contains(Permission.USE))
     751              {
     752                appendPermissionOption(sb, permission, Permission.USE, "Use [U]");
     753              }
     754              if (definedPermission.contains(Permission.RESTRICTED_WRITE))
     755              {
     756                appendPermissionOption(sb, permission, Permission.RESTRICTED_WRITE, "Annotate [A]");
     757              }
     758              if (definedPermission.contains(Permission.WRITE))
     759              {
     760                appendPermissionOption(sb, permission, Permission.WRITE, "Write [W]");
     761              }
     762              if (definedPermission.contains(Permission.DELETE))
     763              {
     764                appendPermissionOption(sb, permission, Permission.DELETE, "Delete [D]");
     765              }
     766              if (definedPermission.contains(Permission.SET_OWNER))
     767              {
     768                appendPermissionOption(sb, permission, Permission.SET_OWNER, "Change owner [O]");
     769              }
     770              if (definedPermission.contains(Permission.SET_PERMISSION))
     771              {
     772                appendPermissionOption(sb, permission, Permission.SET_PERMISSION, "Change permissions [P]");
     773              }
    754774              sb.append("</select>");
    755775            }
Note: See TracChangeset for help on using the changeset viewer.