Project

Profile

Help

Maintenance. Planio will be undergoing a scheduled maintenance this weekend. Between Saturday, July 24 at 9:00 UTC and Sunday, July 25, 22:00 UTC your account might observe occasional downtimes which may last up to several minutes in some cases.

Story #4074

Updated by jortel@redhat.com almost 3 years ago

Plugin content guard logic needs to be loaded and associated with a ContentGuard model (class). The content needs to delegate authorization to the content-guard when handling a GET request.

The logic is loaded an associated with a ContentGuard model (class) using a decorator.

<pre>

@contentguard(model=FooGuard)
def permit(request, content_guard):
pass
</pre>

Something like this In the content app:

<pre>
try:
if distribution.content_guard:
ContentGuardDecorator.permit(request, content_guard)
except PermissionError:
return HttpResponseForbidden()
</pre>

Back