Merge pull request #1580 from sharelatex/ta-entity-create-form-fix-2

Fix Publisher Creation Form Take2

GitOrigin-RevId: a51512cc48067f50ba05fa371ed1d759d3fca985
This commit is contained in:
Timothée Alby
2019-03-14 13:43:12 +00:00
committed by sharelatex
parent a1e16c9676
commit e4c684786d
3 changed files with 23 additions and 4 deletions
@@ -67,6 +67,15 @@ describe "UserMembershipAuthorization", ->
expect(path).to.match /create/
done()
it 'handle entity not found a non-admin can create', (done) ->
@user.staffAccess = { institutionManagement: true }
@UserMembershipHandler.getEntity.yields(null, null)
@UserMembershipHandler.getEntityWithoutAuthorizationCheck.yields(null, null)
@UserMembershipAuthorization.requirePublisherMetricsAccess @req, redirect: (path) =>
expect(path).to.extist
expect(path).to.match /create/
done()
it 'handle entity not found an admin cannot create', (done) ->
@user.isAdmin = true
@UserMembershipHandler.getEntity.yields(null, null)