Commit 5a09366f authored by Manuel Gauto's avatar Manuel Gauto
Browse files

Remove autopublish and insecure. Finish allows

parent c89f4d84
No preview for this file type
......@@ -4,10 +4,7 @@
# but you can also edit it by hand.
meteor-platform
autopublish
insecure
iron:router
ewall:foundation
aldeed:collection2
alanning:roles
......@@ -3,7 +3,6 @@ alanning:roles@1.2.13
aldeed:collection2@2.2.0
aldeed:simple-schema@1.0.3
application-configuration@1.0.3
autopublish@1.0.1
autoupdate@1.1.3
base64@1.0.1
binary-heap@1.0.1
......@@ -25,7 +24,6 @@ html-tools@1.0.2
htmljs@1.0.2
http@1.0.8
id-map@1.0.1
insecure@1.0.1
iron:controller@1.0.0
iron:core@1.0.0
iron:dynamic-template@1.0.0
......
......@@ -83,13 +83,23 @@ if(Meteor.isServer) {
//Allow Statements
Channels.allow({
insert: function(userId, channel) {
return true;
},
remove: function(userId, channel) {
//Check if the user is an admin
if(Roles.userIsInRole(userId, 'admin')) return true;
var channelObj = Channels.findOne(channelMembership.channelId);
var channelOwnerId = channelObj.createdBy;
if(channelOwnerId === userId) return true;
return false;
},
update: function(userId, channel) {
//Check if the user is an admin
if(Roles.userIsInRole(userId, 'admin')) return true;
var channelObj = Channels.findOne(channelMembership.channelId);
var channelOwnerId = channelObj.createdBy;
if(channelOwnerId === userId) return true;
return false;
}
});
ChannelMemberships.allow({
......@@ -100,44 +110,32 @@ if(Meteor.isServer) {
*/
insert: function(userId, channelMembership) {
//Check to see if they are an admin
if(Roles.userIsInRole(loggedInUser, 'admin')) {
return true;
}
if(Roles.userIsInRole(userId, 'admin')) return true;
//Check to see if it their channel
var channelObj = Channels.findOne(channelMembership.channelId);
var channelOwnerId = channelObj.createdBy;
if(channelOwnerId === userId) {
return true;
}
if(channelOwnerId === userId) return true;
//Check if it is their membership
return (channelMembership.userId===userId);
},
remove: function(userId, channelMembership) {
//Check to see if they are an admin
if(Roles.userIsInRole(loggedInUser, 'admin')) {
return true;
}
if(Roles.userIsInRole(userId, 'admin')) return true;
//Check to see if it their channel
var channelObj = Channels.findOne(channelMembership.channelId);
var channelOwnerId = channelObj.createdBy;
if(channelOwnerId === userId) {
return true;
}
if(channelOwnerId === userId) return true;
//Check if it is their membership
return (channelMembership.userId===userId);
},
update: function(userId, channelMembership) {
//Check to see if they are an admin
if(Roles.userIsInRole(loggedInUser, 'admin')) {
return true;
}
if(Roles.userIsInRole(userId, 'admin')) return true;
//Check to see if it their channel
var channelObj = Channels.findOne(channelMembership.channelId);
var channelOwnerId = channelObj.createdBy;
if(channelOwnerId === userId) {
return true;
}
if(channelOwnerId === userId) return true;
//Check if it is their membership
return (channelMembership.userId===userId);
}
......@@ -147,6 +145,8 @@ if(Meteor.isServer) {
return (message.senderId===userId);
},
remove: function(userId, message) {
//Check if admin
if(Roles.userIsInRole(userId, 'admin')) return true;
return (message.senderId===userId);
},
update: function(userId, message) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment