FEATURE: Allow TL4 users to reset bump date
This commit is contained in:
parent
e8053d6e7d
commit
c30996129f
|
@ -211,7 +211,6 @@ export default createWidget("topic-admin-menu", {
|
|||
});
|
||||
}
|
||||
|
||||
if (this.currentUser.get("staff")) {
|
||||
buttons.push({
|
||||
className: "topic-admin-reset-bump-date",
|
||||
buttonClass: "btn-default",
|
||||
|
@ -219,7 +218,6 @@ export default createWidget("topic-admin-menu", {
|
|||
icon: "anchor",
|
||||
label: "actions.reset_bump_date"
|
||||
});
|
||||
}
|
||||
|
||||
if (!isPrivateMessage) {
|
||||
buttons.push({
|
||||
|
|
|
@ -148,6 +148,6 @@ module TopicGuardian
|
|||
end
|
||||
|
||||
def can_update_bumped_at?
|
||||
is_staff?
|
||||
is_staff? || @user.has_trust_level?(TrustLevel[4])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2620,7 +2620,7 @@ RSpec.describe TopicsController do
|
|||
expect(response.status).to eq(403)
|
||||
end
|
||||
|
||||
[:user, :trust_level_4].each do |user|
|
||||
[:user].each do |user|
|
||||
it "denies access for #{user}" do
|
||||
sign_in(Fabricate(user))
|
||||
put "/t/#{topic.id}/reset-bump-date.json"
|
||||
|
@ -2635,7 +2635,7 @@ RSpec.describe TopicsController do
|
|||
end
|
||||
end
|
||||
|
||||
[:admin, :moderator].each do |user|
|
||||
[:admin, :moderator, :trust_level_4].each do |user|
|
||||
it "should reset bumped_at as #{user}" do
|
||||
sign_in(Fabricate(user))
|
||||
topic = Fabricate(:topic, bumped_at: 1.hour.ago)
|
||||
|
|
Loading…
Reference in New Issue