remove redundant authorize_to_view function
This commit is contained in:
parent
d5f66487b7
commit
006acac6b5
3 changed files with 1 additions and 26 deletions
|
@ -107,14 +107,6 @@ class Map < ActiveRecord::Base
|
|||
end
|
||||
return self
|
||||
end
|
||||
|
||||
# returns Boolean if user allowed to view Topic, Synapse, or Map
|
||||
def authorize_to_view(user)
|
||||
if (self.permission == "private" && self.user != user)
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
def decode_base64(imgBase64)
|
||||
decoded_data = Base64.decode64(imgBase64)
|
||||
|
|
|
@ -48,13 +48,4 @@ class Synapse < ActiveRecord::Base
|
|||
end
|
||||
return false
|
||||
end
|
||||
|
||||
# returns Boolean if user allowed to view Topic, Synapse, or Map
|
||||
def authorize_to_view(user)
|
||||
if (self.permission == "private" && self.user != user)
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -78,7 +78,7 @@ class Topic < ActiveRecord::Base
|
|||
def has_viewable_synapses(current)
|
||||
result = false
|
||||
synapses.each do |synapse|
|
||||
if synapse.authorize_to_view(current)
|
||||
if synapse.authorize_to_show(current)
|
||||
result = true
|
||||
end
|
||||
end
|
||||
|
@ -111,12 +111,4 @@ class Topic < ActiveRecord::Base
|
|||
end
|
||||
return false
|
||||
end
|
||||
|
||||
# returns Boolean if user allowed to view Topic, Synapse, or Map
|
||||
def authorize_to_view(user)
|
||||
if (self.permission == "private" && self.user != user)
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue