add permissions to profile page #2417

This commit is contained in:
r888888888
2015-06-30 12:04:19 -07:00
parent b3a665d096
commit d56aa3bc2d
2 changed files with 15 additions and 0 deletions

View File

@@ -25,6 +25,16 @@ class UserPresenter
end
end
def permissions
permissions = []
if user.can_approve_posts?
permissions << "approve posts"
end
permissions.join(", ")
end
def posts_for_subscription(subscription)
arel = Post.where("id in (?)", subscription.post_id_array.map(&:to_i)).order("id desc").limit(6)

View File

@@ -17,6 +17,11 @@
<td><%= presenter.level %></td>
</tr>
<tr>
<th>Permissions</th>
<td><%= presenter.permissions %></td>
</tr>
<% if user.is_banned? && user.recent_ban %>
<tr>
<th>Ban reason</th>