From 1e3d47eb87b5ce272ac9728a7723eb0c6e83d53d Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Mon, 29 Apr 2019 20:28:50 +0000 Subject: [PATCH] Tags Permissions (#2291) * fix: fixed a bug that exposed tags * chore: bumped versions --- docs/source/01-01-talk-quickstart.md | 2 +- docs/source/01-02-installation-from-docker.md | 8 ++++---- docs/source/plugins/overview.md | 2 +- graph/resolvers/util.js | 6 +++--- package.json | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/source/01-01-talk-quickstart.md b/docs/source/01-01-talk-quickstart.md index 7a20377d4..e3e95e290 100644 --- a/docs/source/01-01-talk-quickstart.md +++ b/docs/source/01-01-talk-quickstart.md @@ -55,7 +55,7 @@ Start by making a new directory and create a file called `docker-compose.yml` an version: '2' services: talk: - image: coralproject/talk:4.5 + image: coralproject/talk:4 restart: always ports: - "3000:3000" diff --git a/docs/source/01-02-installation-from-docker.md b/docs/source/01-02-installation-from-docker.md index 0b11cfab5..643823f56 100644 --- a/docs/source/01-02-installation-from-docker.md +++ b/docs/source/01-02-installation-from-docker.md @@ -43,7 +43,7 @@ be used to setup Talk: version: '2' services: talk: - image: coralproject/talk:4.5 + image: coralproject/talk:4 restart: always ports: - "3000:3000" @@ -121,7 +121,7 @@ base installation with additional custom plugins. Images can be created with the most basic of `Dockerfile`'s: ```docker -FROM coralproject/talk:4.5-onbuild +FROM coralproject/talk:4-onbuild ``` And running the following to build the docker image: @@ -153,7 +153,7 @@ your containerized infrastructure. The versioning of our Docker tags as well lets you do something like: ```docker -FROM coralproject/talk:4.5-onbuild +FROM coralproject/talk:4-onbuild ``` -Which would pin your image to `4.5.x release's. +Which would pin your image to `4.x.x release's. diff --git a/docs/source/plugins/overview.md b/docs/source/plugins/overview.md index b4e1f41d5..8f49aeb1f 100644 --- a/docs/source/plugins/overview.md +++ b/docs/source/plugins/overview.md @@ -111,7 +111,7 @@ If you deploy using Docker, you can extend from the `*-onbuild` image, an example `Dockerfile` for your project could be: ```Dockerfile -FROM coralproject/talk:4.5-onbuild +FROM coralproject/talk:4-onbuild ``` Establish a private repository for your instance that includes the following: diff --git a/graph/resolvers/util.js b/graph/resolvers/util.js index a1a745ab2..2c83cd19b 100644 --- a/graph/resolvers/util.js +++ b/graph/resolvers/util.js @@ -64,13 +64,13 @@ const wrapCheck = ( /** * checkPermissions checks that the current user has all the required - * permissions. + * permissions. It will return true if that's the case. * * @param {Object} ctx graph context * @param {Array} permissions permissions that the user must have */ const checkPermissions = (ctx, permissions) => - !ctx.user || !ctx.user.can(...permissions); + ctx.user && ctx.user.can(...permissions); /** * wrapCheckPermissions will wrap a specific field with a permission check. @@ -89,7 +89,7 @@ const wrapCheckPermissions = ( wrapCheck( typeResolver, field, - (obj, args, ctx) => !checkPermissions(ctx, permissions), + (obj, args, ctx) => checkPermissions(ctx, permissions), skipFieldResolver ); diff --git a/package.json b/package.json index 2f76efbff..c6b98acba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "talk", - "version": "4.8.4", + "version": "4.8.5", "description": "A better commenting experience from Mozilla, The New York Times, and the Washington Post. https://coralproject.net", "main": "app.js", "private": true,