2021-01-29 21:19:24 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { LocalizerType } from '../types/Util';
|
2021-07-09 19:36:10 +00:00
|
|
|
import { SignalService as Proto } from '../protobuf';
|
|
|
|
|
|
|
|
const AccessControlEnum = Proto.AccessControl.AccessRequired;
|
2021-01-29 21:19:24 +00:00
|
|
|
|
|
|
|
type AccessControlOption = {
|
2021-06-03 22:12:23 +00:00
|
|
|
text: string;
|
2021-01-29 21:19:24 +00:00
|
|
|
value: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
export function getAccessControlOptions(
|
|
|
|
i18n: LocalizerType
|
|
|
|
): Array<AccessControlOption> {
|
|
|
|
return [
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
text: i18n('icu:GroupV2--all-members'),
|
2021-07-09 19:36:10 +00:00
|
|
|
value: AccessControlEnum.MEMBER,
|
2021-01-29 21:19:24 +00:00
|
|
|
},
|
|
|
|
{
|
2023-03-30 00:03:25 +00:00
|
|
|
text: i18n('icu:GroupV2--only-admins'),
|
2021-07-09 19:36:10 +00:00
|
|
|
value: AccessControlEnum.ADMINISTRATOR,
|
2021-01-29 21:19:24 +00:00
|
|
|
},
|
|
|
|
];
|
|
|
|
}
|