Mostrare il Bene, Servizio, solo ai Propri Gruppi.
Nella pagina profilo, i "Gruppi" personali non si vedevano !
This commit is contained in:
@@ -106,7 +106,7 @@ MyGroupSchema.statics.getFieldsForSearch = function() {
|
||||
return [{field: 'descr', type: tools.FieldType.string}];
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.executeQueryTable = function(idapp, params) {
|
||||
MyGroupSchema.statics.executeQueryTable = function(idapp, params, user) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
|
||||
const { User } = require('./user');
|
||||
@@ -119,7 +119,7 @@ MyGroupSchema.statics.executeQueryTable = function(idapp, params) {
|
||||
}
|
||||
}
|
||||
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
return tools.executeQueryTable(this, idapp, params, user);
|
||||
};
|
||||
|
||||
MyGroupSchema.pre('save', async function(next) {
|
||||
@@ -149,6 +149,18 @@ MyGroupSchema.statics.findAllIdApp = async function(idapp) {
|
||||
return await MyGroup.find(myfind);
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.findAllGroups = async function(idapp) {
|
||||
|
||||
const whatToShow = this.getWhatToShow(idapp, '');
|
||||
|
||||
return await MyGroup.find({
|
||||
idapp,
|
||||
$or: [
|
||||
{deleted: {$exists: false}},
|
||||
{deleted: {$exists: true, $eq: false}}],
|
||||
}, whatToShow);
|
||||
};
|
||||
|
||||
// Rimuovo la Richiesta del Gruppo
|
||||
MyGroupSchema.statics.removeReqGroup = async function(idapp, username, groupnameDest) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user