mirror of
https://github.com/aljazceru/gitpear.git
synced 2025-12-17 14:14:22 +01:00
@@ -107,6 +107,8 @@ module.exports = class RPC {
|
|||||||
url: request.body.url
|
url: request.body.url
|
||||||
}
|
}
|
||||||
if (process.env.GIT_PEAR_AUTH) {
|
if (process.env.GIT_PEAR_AUTH) {
|
||||||
|
if (!request.header) throw new Error('You are not allowed to access this repo')
|
||||||
|
|
||||||
payload = await acl.getId({
|
payload = await acl.getId({
|
||||||
...request.body,
|
...request.body,
|
||||||
payload: request.header
|
payload: request.header
|
||||||
@@ -115,7 +117,7 @@ module.exports = class RPC {
|
|||||||
// check if payload.userId is presenet there
|
// check if payload.userId is presenet there
|
||||||
const aclList = home.getACL(result.repoName)
|
const aclList = home.getACL(result.repoName)
|
||||||
if (!aclList.includes(payload.userId)) {
|
if (!aclList.includes(payload.userId)) {
|
||||||
throw new Error(`You are not allowed to access this repo: ${payload.userId}`)
|
throw new Error('You are not allowed to access this repo')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user