code: @Override
      public IPermissionTarget getTarget(String key) {
  
          /*
           * If the specified key matches one of the "all entity" style targets,
           * just return the appropriate target.
           */
          switch (key) {
              case IPermission.ALL_CATEGORIES_TARGET:
                  return ALL_CATEGORIES_TARGET;
              case IPermission.ALL_PORTLETS_TARGET:
                  return ALL_PORTLETS_TARGET;
              case IPermission.ALL_GROUPS_TARGET:
                  return ALL_GROUPS_TARGET;
                  // Else just fall through...
          }
  
          /*
           * Attempt to find a matching entity for each allowed entity type.  This
           * implementation will return the first entity that it finds. If the
           * portal contains duplicate entity keys across multiple types, it's
           * possible that this implementation would demonstrate inconsistent
           * behavior.
           */
          for (TargetType targetType : allowedTargetTypes) {
              JsonEntityBean entity = groupListHelper.getEntity(targetType.toString(), key, false);
              if (entity != null) {
                  IPermissionTarget target =
                          new PermissionTargetImpl(entity.getId(), entity.getName(), targetType);
                  return target;
              }
          }
  
          return null;
      }
docs: The <code>key</code> parameter <em>should</em> specify a unique entity across all 4 supported
  types: people, groups, portlets, and categories.
  
  <p>Concrete examples of working keys:
  
  <ul>
  <li>admin (user)
  <li>local.0 (group)
  <li>PORTLET_ID.82 (portlet)
  <li>local.1 (category)
  </ul>