mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
[real-time] make sure reviewer has permissions to read a project (#22317)
* added "review" in assertClientCanViewProject * test if reviewer can read project GitOrigin-RevId: 92a30f8b456bec9f0fc81a1361e454eecff838bd
This commit is contained in:
committed by
Copybot
parent
79e854009e
commit
780acfdeb4
@@ -5,7 +5,7 @@ module.exports = AuthorizationManager = {
|
||||
assertClientCanViewProject(client, callback) {
|
||||
AuthorizationManager._assertClientHasPrivilegeLevel(
|
||||
client,
|
||||
['readOnly', 'readAndWrite', 'owner'],
|
||||
['readOnly', 'readAndWrite', 'review', 'owner'],
|
||||
callback
|
||||
)
|
||||
},
|
||||
|
||||
@@ -47,6 +47,17 @@ describe('AuthorizationManager', function () {
|
||||
)
|
||||
})
|
||||
|
||||
it('should allow the review privilegeLevel', function (done) {
|
||||
this.client.ol_context.privilege_level = 'review'
|
||||
return this.AuthorizationManager.assertClientCanViewProject(
|
||||
this.client,
|
||||
error => {
|
||||
expect(error).to.be.null
|
||||
return done()
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
it('should allow the owner privilegeLevel', function (done) {
|
||||
this.client.ol_context.privilege_level = 'owner'
|
||||
return this.AuthorizationManager.assertClientCanViewProject(
|
||||
|
||||
Reference in New Issue
Block a user