elderwand 0.1.41 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -151,12 +151,11 @@ module.exports.inherit = function (child) {
|
|
|
151
151
|
pluralName: child.pluralName,
|
|
152
152
|
//menu: utils.getUserMenu(req.user),
|
|
153
153
|
};
|
|
154
|
-
|
|
155
|
-
if (
|
|
154
|
+
var virtual = new child.model({});
|
|
155
|
+
if (virtual){// && virtual.canEditByUser(req.user)) {
|
|
156
156
|
child.loadRelatedData(data, req, res, function (relatedData) {
|
|
157
157
|
data.inject(relatedData);
|
|
158
158
|
res.statusData = "Success"
|
|
159
|
-
data.item = data[child.singularName]
|
|
160
159
|
|
|
161
160
|
|
|
162
161
|
if(fs.existsSync(viewsDir + child.pluralName)){
|
|
@@ -311,7 +310,7 @@ module.exports.inherit = function (child) {
|
|
|
311
310
|
if (model && model.canEditByUser(req.user)) {
|
|
312
311
|
child.handleFiles(req, res, function(err){
|
|
313
312
|
model.save(function (error, model) {
|
|
314
|
-
EWLog(error, err)
|
|
313
|
+
//EWLog(error, err)
|
|
315
314
|
if (!err && !error) {
|
|
316
315
|
req.flash('success', child.title + ' Başarıyla Güncellendi');
|
|
317
316
|
res.model = model
|
|
@@ -384,7 +383,7 @@ module.exports.inherit = function (child) {
|
|
|
384
383
|
//menu: utils.getUserMenu(req.user),
|
|
385
384
|
};
|
|
386
385
|
data[child.singularName] = req[child.singularName];
|
|
387
|
-
if (data[child.singularName]
|
|
386
|
+
if (data[child.singularName] && data[child.singularName].canSeeByUser(req.user)) {
|
|
388
387
|
child.loadRelatedData(data, req, res, function (relatedData) {
|
|
389
388
|
data.inject(relatedData)
|
|
390
389
|
res.statusData = "Success"
|
|
@@ -419,7 +418,7 @@ module.exports.inherit = function (child) {
|
|
|
419
418
|
// return;
|
|
420
419
|
//};
|
|
421
420
|
var model = req[child.singularName];
|
|
422
|
-
if (model
|
|
421
|
+
if (model && model.canEditByUser(req.user)) {
|
|
423
422
|
model.remove(function (err) {
|
|
424
423
|
req.flash('info', 'Başarıyla Silindi');
|
|
425
424
|
res.statusData = "Success"
|
|
@@ -569,7 +568,7 @@ module.exports.inherit = function (child) {
|
|
|
569
568
|
mv(req.files[key].newPath, req.files[key].dataPath, next)
|
|
570
569
|
}
|
|
571
570
|
}, function(err){
|
|
572
|
-
EWLog(needToSave)
|
|
571
|
+
//EWLog(needToSave)
|
|
573
572
|
if(needToSave){
|
|
574
573
|
req[child.singularName].save(next)
|
|
575
574
|
}else{
|