protected ResourceInstance createAuthorizationResource(String userName, String authorizationId) {
    Map<Resource.Type, String> mapIds = new HashMap<>();
    mapIds.put(Resource.Type.User, StringUtils.lowerCase(userName));
    mapIds.put(Resource.Type.UserAuthorization, authorizationId);
    return createResource(Resource.Type.UserAuthorization, mapIds);
  }
Create an authorization resource.
@param userName         user name
@param authorizationId authorization id
@return an authorization resource instance
ambari-server/src/main/java/org/apache/ambari/server/api/services/users/UserAuthorizationService.java