removed allow() function
This commit is contained in:
parent
54fe1d5695
commit
f402293f71
@ -37,10 +37,6 @@ work.schema = new SimpleSchema({
|
|||||||
done: {type: [String], optional: true}
|
done: {type: [String], optional: true}
|
||||||
});
|
});
|
||||||
|
|
||||||
function allow(user, method) {
|
|
||||||
//Switch/case for different permissions per method/function
|
|
||||||
}
|
|
||||||
|
|
||||||
_uuid4 = function(cc) {
|
_uuid4 = function(cc) {
|
||||||
var rr = Math.random() * 16 | 0;
|
var rr = Math.random() * 16 | 0;
|
||||||
return (cc === 'x' ? rr : (rr & 0x3 | 0x8)).toString(16);
|
return (cc === 'x' ? rr : (rr & 0x3 | 0x8)).toString(16);
|
||||||
@ -52,7 +48,7 @@ Meteor.startup(() => {
|
|||||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, _uuid4);
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, _uuid4);
|
||||||
},
|
},
|
||||||
'createClass': function(input) {
|
'createClass': function(input) {
|
||||||
if(allow(Meteor.userId(),"createClass")) {
|
if(Meteor.user() != null && Meteor.classes.find({status:true, admin:Meteor.userId()}).length < 5){
|
||||||
classes.schema.validate(input);
|
classes.schema.validate(input);
|
||||||
classes.insert(input);
|
classes.insert(input);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user