Merge branch 'master' into thevalueweb

This commit is contained in:
Devin Howard 2015-06-03 18:14:05 -04:00
commit 44e8b8d581
9 changed files with 25 additions and 17 deletions

1
.ruby-version Normal file
View file

@ -0,0 +1 @@
2.1.3

3
Vagrantfile vendored
View file

@ -18,6 +18,9 @@ sudo apt-get install postgresql -y
sudo apt-get install libpq-dev -y
sudo apt-get install redis-server -y
# get imagemagick
sudo apt-get install imagemagick --fix-missing
# Install node
ln -fs /usr/bin/nodejs /usr/bin/node

View file

@ -2775,7 +2775,7 @@ Metamaps.Control = {
var node = Metamaps.Visualize.mGraph.graph.getNode(nodeid);
var topic = node.getData('topic');
var permToDelete = Metamaps.Active.Mapper.id === topic.get('user_id');
var permToDelete = Metamaps.Active.Mapper.id === topic.get('user_id') || Metamaps.Active.Mapper.get('admin');
if (permToDelete) {
var topicid = topic.id;
var mapping = node.getData('mapping');
@ -2944,7 +2944,7 @@ Metamaps.Control = {
var synapse = edge.getData("synapses")[index];
var mapping = edge.getData("mappings")[index];
var permToDelete = Metamaps.Active.Mapper.id === synapse.get('user_id');
var permToDelete = Metamaps.Active.Mapper.id === synapse.get('user_id') || Metamaps.Active.Mapper.get('admin');
if (permToDelete) {
if (edge.getData("synapses").length - 1 === 0) {
Metamaps.Control.hideEdge(edge);

View file

@ -41,10 +41,10 @@ class Synapse < ActiveRecord::Base
end
def authorize_to_delete(user)
if (self.user != user)
return false
if (self.user == user || user.admin)
return self
end
return self
return false
end
# returns Boolean if user allowed to view Topic, Synapse, or Map

View file

@ -112,10 +112,10 @@ class Topic < ActiveRecord::Base
end
def authorize_to_delete(user)
if (self.user != user)
return false
if (self.user == user || user.admin)
return self
end
return self
return false
end
# returns Boolean if user allowed to view Topic, Synapse, or Map

View file

@ -45,7 +45,8 @@ class User < ActiveRecord::Base
def as_json(options={})
{ :id => self.id,
:name => self.name,
:image => self.image.url(:sixtyfour)
:image => self.image.url(:sixtyfour),
:admin => self.admin
}
end

View file

@ -25,10 +25,11 @@ Metamaps::Application.configure do
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'mail.metamaps.cc',
port: 587,
user_name: 'team@metamaps.cc',
password: 'RcxX+s:fht49UX',
address: ENV['SMTP_SERVER'],
port: ENV['SMTP_PORT'],
user_name: ENV['SMTP_USERNAME'],
password: ENV['SMTP_PASSWORD'],
#domain: ENV['SMTP_DOMAIN']
authentication: 'plain',
enable_starttls_auto: true,
openssl_verify_mode: 'none' }

View file

@ -27,10 +27,11 @@ Metamaps::Application.configure do
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'mail.metamaps.cc',
port: 587,
user_name: 'team@metamaps.cc',
password: 'RcxX+s:fht49UX',
address: ENV['SMTP_SERVER'],
port: ENV['SMTP_PORT'],
user_name: ENV['SMTP_USERNAME'],
password: ENV['SMTP_PASSWORD'],
#domain: ENV['SMTP_DOMAIN']
authentication: 'plain',
enable_starttls_auto: true,
openssl_verify_mode: 'none' }

View file

@ -7,6 +7,7 @@ fi
vagrant up
# Bundle!
vagrant ssh --command "cd /vagrant; gem install bundler";
vagrant ssh --command "cd /vagrant; bundle install";
# copy the db config