Don't error out link resolution if user doesn't has permission for the object argument. This issue manifests during the forcefull check in attempt of issue GL #237. Solved and test added.

This commit is contained in:
Roberto Rosario
2015-10-26 02:15:53 -04:00
parent 31846a739d
commit f4a461e5a5
3 changed files with 87 additions and 4 deletions

View File

@@ -11,11 +11,19 @@ from .permissions import (
def is_checked_out(context):
return context['object'].is_checked_out()
try:
return context['object'].is_checked_out()
except KeyError:
# Might not have permissions
return False
def is_not_checked_out(context):
return not context['object'].is_checked_out()
try:
return not context['object'].is_checked_out()
except KeyError:
# Might not have permissions
return True
link_checkout_list = Link(