code: private static boolean mayBrowse(
              final IAuthorizationPrincipal principal, final String targetId) {
          Validate.notNull(principal, "Cannot determine permissions for a null user.");
          Validate.notNull(targetId, "Cannot determine permissions on a null target.");
  
          return (principal.hasPermission(
                  IPermission.PORTAL_SUBSCRIBE, IPermission.PORTLET_BROWSE_ACTIVITY, targetId));
      }
docs: True if the principal has UP_PORTLET_SUBSCRIBE.BROWSE on the target id. The target ID must be
  fully resolved. This method will not e.g. prepend the portlet prefix to target ids that seem
  like they might be portlet IDs.
  
  <p>Implementation note: technically this method is not stateless since asking an
  AuthorizationPrincipal about its permissions has caching side effects in the permissions
  system, but it's stateless as far as this Service is concerned.
  
  @param principal Non-null IAuthorizationPrincipal who might have permission
  @param targetId Non-null identifier of permission target
  @return true if principal has BROWSE permissions, false otherwise