2022-06-13 17:41:35 +05:30
|
|
|
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) {
|
2022-06-13 17:41:35 +05:30
|
|
|
let currentUser = helperContext().currentUser;
|
|
|
|
|
if (currentUser) {
|
2019-10-25 14:00:59 +11:00
|
|
|
return (
|
2022-06-13 17:41:35 +05:30
|
|
|
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;
|
|
|
|
|
});
|