Commit f8253ca1 authored by Jerry Cheung's avatar Jerry Cheung

remove unused can_access_repo? method

parent 2bb594ee
......@@ -41,7 +41,7 @@ module HTML
@result = result || {}
validate
end
# Public: Returns a simple Hash used to pass extra information into filters
# and also to allow filters to make extracted information available to the
# caller.
......@@ -74,7 +74,7 @@ module HTML
def call
raise NotImplementedError
end
# Make sure the context has everything we need. Noop: Subclasses can override.
def validate
end
......@@ -94,18 +94,6 @@ module HTML
context[:current_user]
end
# Return whether the filter can access a given repo while
# applying a filter
#
# A repo can only be accessed if its pullable by the user who
# submitted the content of this filter, or if it's the same as
# the repository context in which the filter runs
def can_access_repo?(repo)
return false if repo.nil?
return true if repo == repository
repo.pullable_by?(current_user)
end
# The site's base URL provided in the context hash, or '/' when no
# base URL was specified.
def base_url
......@@ -158,10 +146,10 @@ module HTML
output.to_s
end
end
# Validator for required context. This will check that anything passed in
# Validator for required context. This will check that anything passed in
# contexts exists in @contexts
#
#
# If any errors are found an ArgumentError will be raised with a
# message listing all the missing contexts and the filters that
# require them.
......@@ -175,4 +163,4 @@ module HTML
end
end
end
end
\ No newline at end of file
end
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