DEV: remove unused isInAnyGroups function (#25741)

Recently we changed the code to check permission in the backend. Example PR https://github.com/discourse/discourse/pull/25735

After those changes, `isInAnyGroups` and `userInAnyGroups` functions are not used anymore.
This commit is contained in:
Krzysztof Kotlarek 2024-02-20 09:08:46 +11:00 committed by GitHub
parent 5ebe91a9a4
commit b215aac317
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 19 deletions

View File

@ -702,20 +702,6 @@ export default class User extends RestModel.extend(Evented) {
return groups.length === 0 ? null : groups;
}
// NOTE: This only includes groups *visible* to the user via the serializer,
// so be wary when using this.
isInAnyGroups(groupIds) {
if (!this.groups) {
return;
}
// auto group ID 0 is "everyone"
return (
groupIds.includes(0) ||
this.groups.mapBy("id").some((groupId) => groupIds.includes(groupId))
);
}
// The user's stat count, excluding PMs.
@discourseComputed("statsExcludingPms.@each.count")
statsCountNonPM() {

View File

@ -18,11 +18,6 @@ export function createSiteSettingsFromPreloaded(data) {
.map((groupId) => parseInt(groupId, 10));
};
settings.userInAnyGroups = (groupSetting, user) => {
const groupIds = settings.groupSettingArray(groupSetting);
return user.isInAnyGroups(groupIds);
};
return settings;
}