@POST
  @Path("/chmod")
  @Consumes(MediaType.APPLICATION_JSON)
  @Produces(MediaType.APPLICATION_JSON)
  public Response chmod(final ChmodRequest request) {
    try {
      HdfsApi api = getApi();
      ResponseBuilder result;
      if (api.chmod(request.path, request.mode)) {
        result = Response.ok(getApi().fileStatusToJSON(api
            .getFileStatus(request.path)));
      } else {
        result = Response.ok(new FileOperationResult(false, "Can't chmod '" + request.path + "'")).status(422);
      }
      return result.build();
    } catch (WebApplicationException ex) {
      throw ex;
    } catch (Exception ex) {
      throw new ServiceFormattedException(ex.getMessage(), ex);
    }
  }
Chmod
@param request chmod request
@return response with success
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/hdfs/FileOperationService.java