move admin permissions to a separate folder

This commit is contained in:
Hazelnoot 2025-06-21 09:15:46 -04:00
parent ec3947b992
commit a4c816d07c
3 changed files with 32 additions and 14 deletions

18
locales/index.d.ts vendored
View file

@ -13455,14 +13455,18 @@ export interface Locale extends ILocale {
* Custom font size
*/
"customFontSize": string;
/**
* Hide ads
*/
"hideAds": string;
/**
* Apps using this token will only have access to the functions listed below.
*/
/**
* Hide ads
*/
"hideAds": string;
/**
* Apps using this token will have no API access except for the functions listed below.
*/
"permissionsDescription": string;
/**
* Apps using this token will have no administrative access except for the functions enabled below.
*/
"adminPermissionsDescription": string;
/**
* Shared account
*/

View file

@ -39,11 +39,19 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="_gaps_s">
<MkSwitch v-for="kind in Object.keys(permissionSwitches)" :key="kind" v-model="permissionSwitches[kind]">{{ i18n.ts._permissions[kind] }}</MkSwitch>
</div>
<div v-if="iAmAdmin" :class="$style.adminPermissions">
<div :class="$style.adminPermissionsHeader"><b>{{ i18n.ts.adminPermission }}</b></div>
<div class="_gaps_s">
<MkSwitch v-for="kind in Object.keys(permissionSwitchesForAdmin)" :key="kind" v-model="permissionSwitchesForAdmin[kind]">{{ i18n.ts._permissions[kind] }}</MkSwitch>
</div>
</MkFolder>
<MkFolder v-if="iAmAdmin">
<template #label>{{ i18n.ts.adminPermission }}</template>
<template #caption>{{ i18n.ts.adminPermissionsDescription }}</template>
<div class="_buttons">
<MkButton inline @click="disableAllAdmin">{{ i18n.ts.disableAll }}</MkButton>
<MkButton inline @click="enableAllAdmin">{{ i18n.ts.enableAll }}</MkButton>
</div>
<div :class="$style.adminPermissions" class="_gaps_s">
<MkSwitch v-for="kind in Object.keys(permissionSwitchesForAdmin)" :key="kind" v-model="permissionSwitchesForAdmin[kind]">{{ i18n.ts._permissions[kind] }}</MkSwitch>
</div>
</MkFolder>
@ -138,6 +146,9 @@ function disableAll(): void {
for (const p in permissionSwitches.value) {
permissionSwitches.value[p] = false;
}
}
function disableAllAdmin(): void {
if (iAmAdmin) {
for (const p in permissionSwitchesForAdmin.value) {
permissionSwitchesForAdmin.value[p] = false;
@ -149,6 +160,9 @@ function enableAll(): void {
for (const p in permissionSwitches.value) {
permissionSwitches.value[p] = true;
}
}
function enableAllAdmin(): void {
if (iAmAdmin) {
for (const p in permissionSwitchesForAdmin.value) {
permissionSwitchesForAdmin.value[p] = true;

View file

@ -679,8 +679,8 @@ customFontSize: "Custom font size"
hideAds: "Hide ads"
permissionsDescription: "Apps using this token will only have access to the functions listed below."
permissionsDescription: "Apps using this token will have no API access except for the functions listed below."
adminPermissionsDescription: "Apps using this token will have no administrative access except for the functions enabled below."
sharedAccount: "Shared account"
sharedAccess: "Shared access"
sharedAccessDescription: "Any accounts listed here will be granted access to the token and may use it to access this account."