Skip to content

Commit

Permalink
apps/communitydebate: add rule modify_topic
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzylogic2000 committed Apr 23, 2020
1 parent 65636ad commit e2a66c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions euth/communitydebate/rules.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import rules
from rules.predicates import is_superuser

from adhocracy4.modules.predicates import (is_context_initiator,
is_context_member,
is_context_moderator, is_owner)
from adhocracy4.phases.predicates import phase_allows_change

rules.add_perm('euth_communitydebate.modify_topic',
is_superuser | is_context_moderator | is_context_initiator |
(is_context_member & is_owner & phase_allows_change))
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<nav class="navbar navbar-default navbar-static">
<ul class="nav navbar-nav">
<li>
<a href="">
<a href="{% url 'project-detail' topic.project.slug %}">
<i class="fa fa-arrow-left" aria-hidden="true"></i>
{% trans 'back to project' %}</a>
</li>
</ul>
{% has_perm 'euth_ideas.modify_idea' request.user idea as show_dropdown %}
{% has_perm 'euth_communitydebate.modify_topic' request.user topic as show_dropdown %}
{% if show_dropdown %}
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
Expand Down

0 comments on commit e2a66c0

Please sign in to comment.