fixes #1479
This commit is contained in:
@@ -35,6 +35,6 @@ class TagsController < ApplicationController
|
||||
|
||||
private
|
||||
def check_privilege(tag)
|
||||
raise User::PrivilegeError unless (CurrentUser.is_builder? || tag.post_count <= 50)
|
||||
raise User::PrivilegeError unless tag.editable_by?(CurrentUser.user)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -561,6 +561,10 @@ class Tag < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def editable_by?(user)
|
||||
user.is_builder? || (user.is_member? && post_count <= 50)
|
||||
end
|
||||
|
||||
include ApiMethods
|
||||
include CountMethods
|
||||
extend ViewCountMethods
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<%= link_to(tag.name, posts_path(:tags => tag.name)) %>
|
||||
</td>
|
||||
<td>
|
||||
<% if CurrentUser.is_builder? || tag.post_count <= 50 %>
|
||||
<% if tag.editable_by?(CurrentUser.user) %>
|
||||
<%= link_to "edit", edit_tag_path(tag) %>
|
||||
<% end %>
|
||||
<% if CurrentUser.is_builder? && tag.post_count < 1_000 %>
|
||||
|
||||
Reference in New Issue
Block a user