Skip to content

Commit

Permalink
check permissions on profile viewer and group viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhuang committed May 27, 2013
1 parent 006b691 commit 8a42d4c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions deme_django/cms/templates/agent/show.html
Expand Up @@ -7,9 +7,11 @@
<div class="row">
<div class="col col-lg-3 thumb"
{% if item.photo %}
{% ifagentcan 'view FileDocument.datafile' item.photo %} style="background-image:url('{{ item.photo.datafile.url }}')
{% ifagentcan 'view Agent.photo' item %}
{% ifagentcan 'view FileDocument.datafile' item.photo %} style="background-image:url('{{ item.photo.datafile.url }}')"
{% endifagentcan %}
{% endif %}">
{% endifagentcan %}
{% endif %}>
</div>

<div class="col col-lg-9">
Expand Down
3 changes: 2 additions & 1 deletion deme_django/cms/templates/group/show.html
Expand Up @@ -19,7 +19,8 @@
<div id="member{{ member.item.pk }}" class="member col col-lg-3">
<a href="{{ member.item.get_absolute_url }}">
<div class="thumb profile-pic"
{% if member.photo %} style="background-image: url('{{ member.photo.datafile.url }}')"{% endif %}
{% if member.photo %}{% ifagentcan 'view Agent.photo' member.item %}
{% ifagentcan 'view FileDocument.datafile' member.photo %} style="background-image: url('{{ member.photo.datafile.url }}')"{% endifagentcan %}{% endifagentcan %}{% endif %}
></div>
</a>
<p class="name"><a href="{{ member.item.get_absolute_url }}">{% viewable_name member.item %}</a></p>
Expand Down
7 changes: 4 additions & 3 deletions deme_django/cms/templates/sample_layout.html
Expand Up @@ -43,9 +43,10 @@ <h3>Generic website banner text</h3>
{% block tabs-section %}
<div class="tabs-section">
<ul class="nav nav-tabs">
<li {% ifequal full_path "/" %}class="active"{% endifequal %}><a href="/">Welcome</a></li>
<li {% ifequal full_path "/viewing/discussion/25" %}class="active"{% endifequal %}><a href="/viewing/discussion/25">Discussion</a></li>
<li {% ifequal full_path "/viewing/agreedisagreepoll" %}class="active"{% endifequal %}><a href="/viewing/agreedisagreepoll">Polls</a></li>
<li {% ifequal full_path "/" %}class="active"{% endifequal %}><a href="/">1: Welcome</a></li>
<li {% ifequal full_path "/viewing/discussion/9" %}class="active"{% endifequal %}><a href="/viewing/discussion/9">2: Discussion</a></li>
<li {% ifequal full_path "/viewing/agreedisagreepoll" %}class="active"{% endifequal %}><a href="/viewing/agreedisagreepoll">3: Polls</a></li>
<li {% ifequal full_path "/viewing/djangotemplatedocument/8" %}class="active"{% endifequal %}><a href="/viewing/djangotemplatedocument/8">4: Sample Layout</a></li>
</ul>
</div>
{% endblock tabs-section %}
Expand Down

0 comments on commit 8a42d4c

Please sign in to comment.