Files

14 lines
369 B
JavaScript
Raw Permalink Normal View History

import { helperContext, registerUnbound } from "discourse-common/lib/helpers";
2019-10-25 13:23:32 +11:00
2020-09-16 09:53:50 -05:00
export default registerUnbound("user-viewing-self", function (model) {
let currentUser = helperContext().currentUser;
if (currentUser) {
2019-10-25 14:00:59 +11:00
return (
currentUser.admin ||
currentUser.username?.toLowerCase() === model.username?.toLowerCase()
2019-10-25 14:00:59 +11:00
);
2019-10-25 13:23:32 +11:00
}
return false;
});