Check for capabilites instead of roles in allow_link
This commit is contained in:
@@ -126,11 +126,7 @@ def view(node_id, extra_template_args: dict=None):
|
|||||||
if node.permissions and node.permissions.world:
|
if node.permissions and node.permissions.world:
|
||||||
return 'GET' in node.permissions.world
|
return 'GET' in node.permissions.world
|
||||||
|
|
||||||
if current_user.is_authenticated:
|
return current_user.has_cap('subscriber')
|
||||||
allowed_roles = {'subscriber', 'demo', 'admin'}
|
|
||||||
return bool(allowed_roles.intersection(current_user.roles or ()))
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
link_allowed = allow_link()
|
link_allowed = allow_link()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user