screwdriver-api 8.0.187 → 8.0.188

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-api",
3
- "version": "8.0.187",
3
+ "version": "8.0.188",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/plugins/helper.js CHANGED
@@ -55,6 +55,10 @@ async function getUserPermissions({ user, scmUri, level = 'admin', isAdmin = fal
55
55
  try {
56
56
  permissions = await user.getPermissions(scmUri);
57
57
  } catch (err) {
58
+ if (err.statusCode === 404) {
59
+ throw boom.notFound(err);
60
+ }
61
+
58
62
  permissions = null;
59
63
  }
60
64
 
@@ -178,6 +178,8 @@ module.exports = () => ({
178
178
  } catch (err) {
179
179
  if (isScrewdriverAdmin) {
180
180
  oldPermissions = { admin: false };
181
+ } else if (err.statusCode === 404) {
182
+ throw boom.notFound(err);
181
183
  } else {
182
184
  throw boom.forbidden(
183
185
  `User ${user.getFullDisplayName()} does not have admin permission for this repo`