screwdriver-api 8.0.186 → 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 +1 -1
- package/plugins/helper.js +4 -0
- package/plugins/pipelines/update.js +2 -0
package/package.json
CHANGED
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`
|