Made owner of sheets and libraries more visible
This commit is contained in:
@@ -82,7 +82,14 @@ Meteor.publish('libraryCollection', function (libraryCollectionId) {
|
||||
}, {
|
||||
sort: { name: 1 }
|
||||
});
|
||||
return [libraryCollectionCursor, libraryCursor];
|
||||
return [
|
||||
libraryCollectionCursor,
|
||||
libraryCursor,
|
||||
Meteor.users.find(
|
||||
libraryCollection.owner,
|
||||
{ fields: { username: 1 } }
|
||||
),
|
||||
];
|
||||
});
|
||||
});
|
||||
})
|
||||
@@ -148,13 +155,21 @@ Meteor.publish('browseLibraries', function () {
|
||||
showInMarket: true,
|
||||
public: true,
|
||||
}, {
|
||||
sort: { name: 1 }
|
||||
sort: {
|
||||
subscriberCount: 1,
|
||||
name: 1,
|
||||
},
|
||||
limit: 500,
|
||||
}),
|
||||
LibraryCollections.find({
|
||||
showInMarket: true,
|
||||
public: true,
|
||||
}, {
|
||||
sort: { name: 1 }
|
||||
sort: {
|
||||
subscriberCount: 1,
|
||||
name: 1
|
||||
},
|
||||
limit: 500,
|
||||
}),
|
||||
];
|
||||
});
|
||||
@@ -169,9 +184,15 @@ Meteor.publish('library', function (libraryId) {
|
||||
catch (e) {
|
||||
return this.error(e);
|
||||
}
|
||||
return Libraries.find({
|
||||
_id: libraryId,
|
||||
});
|
||||
return [
|
||||
Libraries.find({
|
||||
_id: libraryId,
|
||||
}),
|
||||
Meteor.users.find(
|
||||
library.owner,
|
||||
{ fields: { username: 1 } }
|
||||
),
|
||||
];
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ Meteor.publish('singleCharacter', function (creatureId) {
|
||||
const self = this;
|
||||
try {
|
||||
schema.validate({ creatureId });
|
||||
} catch (e){
|
||||
} catch (e) {
|
||||
this.error(e);
|
||||
}
|
||||
this.autorun(function (computation){
|
||||
this.autorun(function (computation) {
|
||||
let userId = this.userId;
|
||||
let permissionCreature = Creatures.findOne({
|
||||
_id: creatureId,
|
||||
@@ -32,11 +32,11 @@ Meteor.publish('singleCharacter', function (creatureId) {
|
||||
try { assertViewPermission(permissionCreature, userId) }
|
||||
catch (e) { return [] }
|
||||
loadCreature(creatureId, self);
|
||||
if (permissionCreature.computeVersion !== VERSION && computation.firstRun){
|
||||
if (permissionCreature.computeVersion !== VERSION && computation.firstRun) {
|
||||
try {
|
||||
computeCreature(creatureId)
|
||||
}
|
||||
catch(e){ console.error(e) }
|
||||
catch (e) { console.error(e) }
|
||||
}
|
||||
return [
|
||||
Creatures.find({
|
||||
@@ -52,7 +52,13 @@ Meteor.publish('singleCharacter', function (creatureId) {
|
||||
creatureId,
|
||||
}, {
|
||||
limit: 20,
|
||||
sort: {date: -1},
|
||||
sort: { date: -1 },
|
||||
}),
|
||||
// Also publish the owner's username
|
||||
Meteor.users.find(permissionCreature.owner, {
|
||||
fields: {
|
||||
username: 1,
|
||||
},
|
||||
}),
|
||||
];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user