FIX: show all staff events related to the target user
This commit is contained in:
parent
b32f33b3f0
commit
213a496203
|
@ -33,7 +33,7 @@ export default Discourse.Route.extend({
|
|||
viewActionLogs(username) {
|
||||
const controller = this.controllerFor('adminLogs.staffActionLogs');
|
||||
this.transitionTo('adminLogs.staffActionLogs').then(() => {
|
||||
controller._changeFilters({ acting_user: username });
|
||||
controller._changeFilters({ target_user: username });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ class Guardian
|
|||
end
|
||||
|
||||
def can_view_action_logs?(target)
|
||||
is_staff? && target && target.staff?
|
||||
is_staff? && target
|
||||
end
|
||||
|
||||
# Can we approve it?
|
||||
|
|
|
@ -289,12 +289,8 @@ describe Guardian do
|
|||
expect(Guardian.new(moderator).can_view_action_logs?(nil)).to be_falsey
|
||||
end
|
||||
|
||||
it 'is false for non-staff target user' do
|
||||
expect(Guardian.new(moderator).can_view_action_logs?(user)).to be_falsey
|
||||
end
|
||||
|
||||
it 'is true for staff target user' do
|
||||
expect(Guardian.new(moderator).can_view_action_logs?(admin)).to be_truthy
|
||||
it 'is true when target user is present' do
|
||||
expect(Guardian.new(moderator).can_view_action_logs?(user)).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue