code: public Map<String, Map<String, List<String>>> grantResourcePermission(String subjectid, String resourcePath,
  			EnumSet<App.AllowedMethods> permission, boolean allowGuestAccess) {
  		if (StringUtils.isBlank(subjectid) || StringUtils.isBlank(resourcePath) || permission == null) {
  			return Collections.emptyMap();
  		}
  		if (allowGuestAccess && App.ALLOW_ALL.equals(subjectid)) {
  			permission.add(App.AllowedMethods.GUEST);
  		}
  		resourcePath = Utils.urlEncode(resourcePath);
  		return getEntity(invokePut(Utils.formatMessage("_permissions/{0}/{1}", subjectid, resourcePath),
  				Entity.json(permission)), Map.class);
  	}
docs: Grants a permission to a subject that allows them to call the specified HTTP methods on a given resource.
  @param subjectid subject id (user id)
  @param resourcePath resource path or object type
  @param permission a set of HTTP methods
  @param allowGuestAccess if true - all unauthenticated requests will go through, 'false' by default.
  @return a map of the permissions for this subject id