Story #4074
Updated by jortel@redhat.com about 6 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>