Edit permission is no longer patreon-only

This commit is contained in:
Stefan Zermatten
2021-06-21 16:32:24 +02:00
parent 5f5fe801f6
commit 54bf21c57c

View File

@@ -1,6 +1,5 @@
import { _ } from 'meteor/underscore';
import fetchDocByRef from '/imports/api/parenting/fetchDocByRef.js';
import { getUserTier } from '/imports/api/users/patreon/tiers.js';
function assertIdValid(userId){
if (!userId || typeof userId !== 'string'){
@@ -48,13 +47,6 @@ export function assertEditPermission(doc, userId) {
return true;
}
// Ensure the user is of a tier with paid benefits
let tier = getUserTier(user);
if (!tier.paidBenefits){
throw new Meteor.Error('Edit permission denied',
`The ${tier.name} tier does not allow you to edit this document`);
}
// Ensure the user is authorized for this specific document
if (
doc.owner === userId ||