Merge branch 'master' into thevalueweb
This commit is contained in:
commit
44e8b8d581
9 changed files with 25 additions and 17 deletions
1
.ruby-version
Normal file
1
.ruby-version
Normal file
|
@ -0,0 +1 @@
|
||||||
|
2.1.3
|
3
Vagrantfile
vendored
3
Vagrantfile
vendored
|
@ -18,6 +18,9 @@ sudo apt-get install postgresql -y
|
||||||
sudo apt-get install libpq-dev -y
|
sudo apt-get install libpq-dev -y
|
||||||
sudo apt-get install redis-server -y
|
sudo apt-get install redis-server -y
|
||||||
|
|
||||||
|
# get imagemagick
|
||||||
|
sudo apt-get install imagemagick --fix-missing
|
||||||
|
|
||||||
# Install node
|
# Install node
|
||||||
ln -fs /usr/bin/nodejs /usr/bin/node
|
ln -fs /usr/bin/nodejs /usr/bin/node
|
||||||
|
|
||||||
|
|
|
@ -2775,7 +2775,7 @@ Metamaps.Control = {
|
||||||
var node = Metamaps.Visualize.mGraph.graph.getNode(nodeid);
|
var node = Metamaps.Visualize.mGraph.graph.getNode(nodeid);
|
||||||
var topic = node.getData('topic');
|
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) {
|
if (permToDelete) {
|
||||||
var topicid = topic.id;
|
var topicid = topic.id;
|
||||||
var mapping = node.getData('mapping');
|
var mapping = node.getData('mapping');
|
||||||
|
@ -2944,7 +2944,7 @@ Metamaps.Control = {
|
||||||
var synapse = edge.getData("synapses")[index];
|
var synapse = edge.getData("synapses")[index];
|
||||||
var mapping = edge.getData("mappings")[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 (permToDelete) {
|
||||||
if (edge.getData("synapses").length - 1 === 0) {
|
if (edge.getData("synapses").length - 1 === 0) {
|
||||||
Metamaps.Control.hideEdge(edge);
|
Metamaps.Control.hideEdge(edge);
|
||||||
|
|
|
@ -41,10 +41,10 @@ class Synapse < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def authorize_to_delete(user)
|
def authorize_to_delete(user)
|
||||||
if (self.user != user)
|
if (self.user == user || user.admin)
|
||||||
return false
|
return self
|
||||||
end
|
end
|
||||||
return self
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns Boolean if user allowed to view Topic, Synapse, or Map
|
# returns Boolean if user allowed to view Topic, Synapse, or Map
|
||||||
|
|
|
@ -112,10 +112,10 @@ class Topic < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def authorize_to_delete(user)
|
def authorize_to_delete(user)
|
||||||
if (self.user != user)
|
if (self.user == user || user.admin)
|
||||||
return false
|
return self
|
||||||
end
|
end
|
||||||
return self
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns Boolean if user allowed to view Topic, Synapse, or Map
|
# returns Boolean if user allowed to view Topic, Synapse, or Map
|
||||||
|
|
|
@ -45,7 +45,8 @@ class User < ActiveRecord::Base
|
||||||
def as_json(options={})
|
def as_json(options={})
|
||||||
{ :id => self.id,
|
{ :id => self.id,
|
||||||
:name => self.name,
|
:name => self.name,
|
||||||
:image => self.image.url(:sixtyfour)
|
:image => self.image.url(:sixtyfour),
|
||||||
|
:admin => self.admin
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,11 @@ Metamaps::Application.configure do
|
||||||
|
|
||||||
config.action_mailer.delivery_method = :smtp
|
config.action_mailer.delivery_method = :smtp
|
||||||
config.action_mailer.smtp_settings = {
|
config.action_mailer.smtp_settings = {
|
||||||
address: 'mail.metamaps.cc',
|
address: ENV['SMTP_SERVER'],
|
||||||
port: 587,
|
port: ENV['SMTP_PORT'],
|
||||||
user_name: 'team@metamaps.cc',
|
user_name: ENV['SMTP_USERNAME'],
|
||||||
password: 'RcxX+s:fht49UX',
|
password: ENV['SMTP_PASSWORD'],
|
||||||
|
#domain: ENV['SMTP_DOMAIN']
|
||||||
authentication: 'plain',
|
authentication: 'plain',
|
||||||
enable_starttls_auto: true,
|
enable_starttls_auto: true,
|
||||||
openssl_verify_mode: 'none' }
|
openssl_verify_mode: 'none' }
|
||||||
|
|
|
@ -27,10 +27,11 @@ Metamaps::Application.configure do
|
||||||
|
|
||||||
config.action_mailer.delivery_method = :smtp
|
config.action_mailer.delivery_method = :smtp
|
||||||
config.action_mailer.smtp_settings = {
|
config.action_mailer.smtp_settings = {
|
||||||
address: 'mail.metamaps.cc',
|
address: ENV['SMTP_SERVER'],
|
||||||
port: 587,
|
port: ENV['SMTP_PORT'],
|
||||||
user_name: 'team@metamaps.cc',
|
user_name: ENV['SMTP_USERNAME'],
|
||||||
password: 'RcxX+s:fht49UX',
|
password: ENV['SMTP_PASSWORD'],
|
||||||
|
#domain: ENV['SMTP_DOMAIN']
|
||||||
authentication: 'plain',
|
authentication: 'plain',
|
||||||
enable_starttls_auto: true,
|
enable_starttls_auto: true,
|
||||||
openssl_verify_mode: 'none' }
|
openssl_verify_mode: 'none' }
|
||||||
|
|
|
@ -7,6 +7,7 @@ fi
|
||||||
vagrant up
|
vagrant up
|
||||||
|
|
||||||
# Bundle!
|
# Bundle!
|
||||||
|
vagrant ssh --command "cd /vagrant; gem install bundler";
|
||||||
vagrant ssh --command "cd /vagrant; bundle install";
|
vagrant ssh --command "cd /vagrant; bundle install";
|
||||||
|
|
||||||
# copy the db config
|
# copy the db config
|
||||||
|
|
Loading…
Add table
Reference in a new issue