removed insecure, disabled user editing of chromebooks/carts
This commit is contained in:
parent
71c8ceef5a
commit
1f4d87e46e
@ -5,7 +5,6 @@
|
|||||||
# but you can also edit it by hand.
|
# but you can also edit it by hand.
|
||||||
|
|
||||||
meteor-platform
|
meteor-platform
|
||||||
insecure
|
|
||||||
iron:router
|
iron:router
|
||||||
momentjs:moment
|
momentjs:moment
|
||||||
accounts-google
|
accounts-google
|
||||||
|
|||||||
@ -26,7 +26,6 @@ html-tools@1.0.3
|
|||||||
htmljs@1.0.3
|
htmljs@1.0.3
|
||||||
http@1.0.9
|
http@1.0.9
|
||||||
id-map@1.0.2
|
id-map@1.0.2
|
||||||
insecure@1.0.2
|
|
||||||
iron:controller@1.0.6
|
iron:controller@1.0.6
|
||||||
iron:core@1.0.6
|
iron:core@1.0.6
|
||||||
iron:dynamic-template@1.0.6
|
iron:dynamic-template@1.0.6
|
||||||
|
|||||||
@ -11,4 +11,32 @@ Template.checkout.rendered = function() {
|
|||||||
mouseWheel: { deltaFactor: 40 },
|
mouseWheel: { deltaFactor: 40 },
|
||||||
alwaysShowScrollbar: 2
|
alwaysShowScrollbar: 2
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Object.defineProperty(window, "console", {
|
||||||
|
value: console,
|
||||||
|
writable: false,
|
||||||
|
configurable: false
|
||||||
|
});
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
function showWarningAndThrow() {
|
||||||
|
if (!i) {
|
||||||
|
setTimeout(function () {
|
||||||
|
console.log("%cWarning message", "font: 2em sans-serif; color: yellow; background-color: red;");
|
||||||
|
}, 1);
|
||||||
|
i = 1;
|
||||||
|
}
|
||||||
|
throw "Console is disabled";
|
||||||
|
}
|
||||||
|
|
||||||
|
var l, n = {
|
||||||
|
set: function (o) {
|
||||||
|
l = o;
|
||||||
|
},
|
||||||
|
get: function () {
|
||||||
|
showWarningAndThrow();
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Object.defineProperty(console, "_commandLineAPI", n);
|
||||||
|
Object.defineProperty(console, "__commandLineAPI", n);
|
||||||
@ -1,13 +1 @@
|
|||||||
carts = new Mongo.Collection("carts");
|
carts = new Mongo.Collection("carts");
|
||||||
// carts.allow({
|
|
||||||
// insert: function (userId, doc) {
|
|
||||||
// return Roles.userIsInRole(userId, ['admin']);
|
|
||||||
// },
|
|
||||||
// update: function (userId, doc) {
|
|
||||||
// return Roles.userIsInRole(userId, ['admin', 'teacher'];
|
|
||||||
// },
|
|
||||||
// remove: function (userId, doc) {
|
|
||||||
// return Roles.userIsInRole(userId, ['admin']);
|
|
||||||
// },
|
|
||||||
// fetch: []
|
|
||||||
// });
|
|
||||||
@ -1,13 +1 @@
|
|||||||
Chromebooks = new Mongo.Collection("chromebook");
|
Chromebooks = new Mongo.Collection("chromebook");
|
||||||
// Chromebooks.allow({
|
|
||||||
// insert: function (userId, doc) {
|
|
||||||
// return Roles.userIsInRole(userId, ['admin']);
|
|
||||||
// },
|
|
||||||
// update: function (userId, doc) {
|
|
||||||
// return (userId != null);
|
|
||||||
// },
|
|
||||||
// remove: function (userId, doc) {
|
|
||||||
// return Roles.userIsInRole(userId, ['admin']);
|
|
||||||
// },
|
|
||||||
// fetch: []
|
|
||||||
// });
|
|
||||||
@ -16,7 +16,16 @@ Meteor.publish('carts', function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Chromebooks.permit(['insert', 'update', 'remove']).never().apply();
|
Chromebooks.permit(['insert', 'update', 'remove']).ifHasRole('admin').apply();
|
||||||
|
carts.permit(['insert', 'update', 'remove']).ifHasRole(['admin', 'teacher']).apply();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*if ( Check if Meteor.userId() != Current logged in user Meteor.userId if they update hack way ) {
|
||||||
|
Chromebooks.update
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
var adminusers = [
|
var adminusers = [
|
||||||
//Add all Users here
|
//Add all Users here
|
||||||
"mminer@bloomfield.org",
|
"mminer@bloomfield.org",
|
||||||
@ -77,4 +86,6 @@ Meteor.methods({
|
|||||||
|
|
||||||
Roles.setUserRoles(targetUserId, roles, group)
|
Roles.setUserRoles(targetUserId, roles, group)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user