Add ensureUserCanSendComment authorization middleware (#22959)
* Add ensureUserCanSendComment authorization middleware * added tests GitOrigin-RevId: d1f58bd6bc63275456e5280ccb8c99aaa02c4e5f
This commit is contained in:
committed by
Copybot
parent
e5a4a8606f
commit
741b65d0eb
@@ -462,6 +462,15 @@ describe('AuthorizationManager', function () {
|
||||
tokenReadAndWrite: true,
|
||||
})
|
||||
|
||||
testPermission('canUserSendComment', {
|
||||
siteAdmin: true,
|
||||
owner: true,
|
||||
readAndWrite: true,
|
||||
review: true,
|
||||
publicReadAndWrite: true,
|
||||
tokenReadAndWrite: true,
|
||||
})
|
||||
|
||||
testPermission('canUserWriteProjectContent', {
|
||||
siteAdmin: true,
|
||||
owner: true,
|
||||
|
||||
@@ -26,6 +26,7 @@ describe('AuthorizationMiddleware', function () {
|
||||
canUserWriteProjectSettings: sinon.stub(),
|
||||
canUserWriteProjectContent: sinon.stub(),
|
||||
canUserResolveThread: sinon.stub(),
|
||||
canUserSendComment: sinon.stub(),
|
||||
canUserAdminProject: sinon.stub(),
|
||||
canUserRenameProject: sinon.stub(),
|
||||
canUserReviewProjectContent: sinon.stub(),
|
||||
@@ -86,6 +87,10 @@ describe('AuthorizationMiddleware', function () {
|
||||
)
|
||||
})
|
||||
|
||||
describe('ensureUserCanSendComment', function () {
|
||||
testMiddleware('ensureUserCanSendComment', 'canUserSendComment')
|
||||
})
|
||||
|
||||
describe('ensureUserCanResolveThread', function () {
|
||||
beforeEach(function () {
|
||||
this.req.params.doc_id = this.doc_id
|
||||
|
||||
Reference in New Issue
Block a user