feat: add Organization.HasPrivilegeConsent to block add-user API for the "built-in" org (#3864)

This commit is contained in:
DacongDA
2025-06-06 23:05:01 +08:00
committed by GitHub
parent c6a50349cc
commit 4cb0cd7c5a
61 changed files with 213 additions and 63 deletions

View File

@ -13,7 +13,7 @@
// limitations under the License.
import React from "react";
import {Button, Card, Col, Input, InputNumber, Radio, Row, Select, Switch} from "antd";
import {Button, Card, Col, Input, InputNumber, Popconfirm, Radio, Row, Select, Switch} from "antd";
import * as OrganizationBackend from "./backend/OrganizationBackend";
import * as ApplicationBackend from "./backend/ApplicationBackend";
import * as LdapBackend from "./backend/LdapBackend";
@ -270,6 +270,25 @@ class OrganizationEditPage extends React.Component {
}} />
</Col>
</Row>
{
this.state.organization.name === "built-in" ? (
<Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 19 : 2}>
{Setting.getLabel(i18next.t("organization:Has privilege consent"), i18next.t("organization:Has privilege consent - Tooltip"))} :
</Col>
<Col span={1} >
<Popconfirm
title={i18next.t("organization:Has privilege consent warning")}
onConfirm={() => {this.updateOrganizationField("hasPrivilegeConsent", !this.state.organization.hasPrivilegeConsent);}}
okText={i18next.t("general:OK")}
cancelText={i18next.t("general:Cancel")}
>
<Switch checked={this.state.organization.hasPrivilegeConsent} />
</Popconfirm>
</Col>
</Row>
) : null
}
<Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Password type"), i18next.t("general:Password type - Tooltip"))} :

View File

@ -616,6 +616,9 @@
"All": "All",
"Edit Organization": "Edit Organization",
"Follow global theme": "Follow global theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Init score",
"Init score - Tooltip": "Initial score points awarded to users upon registration",
"Is profile public": "Is profile public",

View File

@ -616,6 +616,9 @@
"All": "Vše",
"Edit Organization": "Upravit organizaci",
"Follow global theme": "Sledovat globální téma",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Počáteční skóre",
"Init score - Tooltip": "Počáteční body udělené uživatelům při registraci",
"Is profile public": "Je profil veřejný",

View File

@ -616,6 +616,9 @@
"All": "Alle",
"Edit Organization": "Organisation bearbeiten",
"Follow global theme": "Folge dem globalen Theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Initialer Score",
"Init score - Tooltip": "Anfangspunkte, die Benutzern bei der Registrierung vergeben werden",
"Is profile public": "Ist das Profil öffentlich?",

View File

@ -616,6 +616,9 @@
"All": "All",
"Edit Organization": "Edit Organization",
"Follow global theme": "Follow global theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Init score",
"Init score - Tooltip": "Initial score points awarded to users upon registration",
"Is profile public": "Is profile public",

View File

@ -616,6 +616,9 @@
"All": "Toda",
"Edit Organization": "Editar organización",
"Follow global theme": "Seguir el tema global",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Puntuación de inicio",
"Init score - Tooltip": "Puntos de puntuación inicial otorgados a los usuarios al registrarse",
"Is profile public": "Es el perfil público",

View File

@ -616,6 +616,9 @@
"All": "همه",
"Edit Organization": "ویرایش سازمان",
"Follow global theme": "پیروی از تم جهانی",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "امتیاز اولیه",
"Init score - Tooltip": "امتیاز اولیه‌ای که به کاربران هنگام ثبت‌نام اعطا می‌شود",
"Is profile public": "پروفایل عمومی است",

View File

@ -616,6 +616,9 @@
"All": "All",
"Edit Organization": "Edit Organization",
"Follow global theme": "Follow global theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Init score",
"Init score - Tooltip": "Initial score points awarded to users upon registration",
"Is profile public": "Is profile public",

View File

@ -616,6 +616,9 @@
"All": "Tout",
"Edit Organization": "Modifier l'organisation",
"Follow global theme": "Suivre le thème global",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Score initial",
"Init score - Tooltip": "Score initial attribué au compte lors de leur inscription",
"Is profile public": "Est-ce que le profil est public ?",

View File

@ -616,6 +616,9 @@
"All": "All",
"Edit Organization": "Edit Organization",
"Follow global theme": "Follow global theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Init score",
"Init score - Tooltip": "Initial score points awarded to users upon registration",
"Is profile public": "Is profile public",

View File

@ -616,6 +616,9 @@
"All": "Semua",
"Edit Organization": "Edit Organisasi",
"Follow global theme": "Ikuti tema global",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Skor awal",
"Init score - Tooltip": "Poin skor awal diberikan kepada pengguna saat pendaftaran",
"Is profile public": "Apakah profilnya publik?",

View File

@ -616,6 +616,9 @@
"All": "All",
"Edit Organization": "Edit Organization",
"Follow global theme": "Follow global theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Init score",
"Init score - Tooltip": "Initial score points awarded to users upon registration",
"Is profile public": "Is profile public",

View File

@ -616,6 +616,9 @@
"All": "全て",
"Edit Organization": "組織の編集",
"Follow global theme": "グローバルテーマに従ってください",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "イニットスコア",
"Init score - Tooltip": "登録時にユーザーに与えられる初期スコアポイント",
"Is profile public": "プロフィールは公開されていますか?",

View File

@ -616,6 +616,9 @@
"All": "All",
"Edit Organization": "Edit Organization",
"Follow global theme": "Follow global theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Init score",
"Init score - Tooltip": "Initial score points awarded to users upon registration",
"Is profile public": "Is profile public",

View File

@ -616,6 +616,9 @@
"All": "모두",
"Edit Organization": "단체 수정",
"Follow global theme": "글로벌 테마를 따르세요",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "처음 점수",
"Init score - Tooltip": "등록 시 초기 점수 부여",
"Is profile public": "프로필이 공개적으로 되어 있나요?",

View File

@ -616,6 +616,9 @@
"All": "All",
"Edit Organization": "Edit Organization",
"Follow global theme": "Follow global theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Init score",
"Init score - Tooltip": "Initial score points awarded to users upon registration",
"Is profile public": "Is profile public",

View File

@ -616,6 +616,9 @@
"All": "All",
"Edit Organization": "Edit Organization",
"Follow global theme": "Follow global theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Init score",
"Init score - Tooltip": "Initial score points awarded to users upon registration",
"Is profile public": "Is profile public",

View File

@ -616,6 +616,9 @@
"All": "All",
"Edit Organization": "Edit Organization",
"Follow global theme": "Follow global theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Init score",
"Init score - Tooltip": "Initial score points awarded to users upon registration",
"Is profile public": "Is profile public",

View File

@ -616,6 +616,9 @@
"All": "Todos",
"Edit Organization": "Editar Organização",
"Follow global theme": "Seguir tema global",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Pontuação inicial",
"Init score - Tooltip": "Pontos de pontuação inicial concedidos aos usuários no momento do registro",
"Is profile public": "Perfil é público",

View File

@ -616,6 +616,9 @@
"All": "Все",
"Edit Organization": "Редактировать организацию",
"Follow global theme": "Следуйте глобальной теме",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Начальный балл",
"Init score - Tooltip": "Первоначальное количество баллов, присваиваемое пользователям при регистрации",
"Is profile public": "Профиль является публичным?",

View File

@ -616,6 +616,9 @@
"All": "Všetko",
"Edit Organization": "Upraviť organizáciu",
"Follow global theme": "Nasledovať globálnu tému",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Počiatočné skóre",
"Init score - Tooltip": "Počiatočné skóre body pridelí používateľom pri registrácii",
"Is profile public": "Je profil verejný",

View File

@ -616,6 +616,9 @@
"All": "All",
"Edit Organization": "Edit Organization",
"Follow global theme": "Follow global theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Init score",
"Init score - Tooltip": "Initial score points awarded to users upon registration",
"Is profile public": "Is profile public",

View File

@ -616,6 +616,9 @@
"All": "Tümü",
"Edit Organization": "Edit Organization",
"Follow global theme": "Follow global theme",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Init score",
"Init score - Tooltip": "Initial score points awarded to users upon registration",
"Is profile public": "Is profile public",

View File

@ -616,6 +616,9 @@
"All": "всі",
"Edit Organization": "Редагувати організацію",
"Follow global theme": "Дотримуйтеся глобальної теми",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Початкова оцінка",
"Init score - Tooltip": "Початкові бали, нараховані користувачам під час реєстрації",
"Is profile public": "Профіль загальнодоступний",

View File

@ -616,6 +616,9 @@
"All": "Tất cả",
"Edit Organization": "Sửa tổ chức",
"Follow global theme": "Theo giao diện chung",
"Has privilege consent": "Has privilege consent",
"Has privilege consent - Tooltip": "Prevent adding users for built-in organization if HasPrivilegeConsent is false",
"Has privilege consent warning": "Adding a new user to the 'built-in' organization is currently disabled. Please note: all users in the 'built-in' organization are global administrators in Casdoor. Refer to the docs: https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself. If you still wish to create a user for the 'built-in' organization, go to the organization's settings page and enable the 'Has privilege consent' option.",
"Init score": "Điểm khởi tạo",
"Init score - Tooltip": "Điểm số ban đầu được trao cho người dùng khi đăng ký",
"Is profile public": "Hồ sơ có công khai không?",

View File

@ -616,6 +616,9 @@
"All": "全部",
"Edit Organization": "编辑组织",
"Follow global theme": "使用全局默认主题",
"Has privilege consent": "特权同意",
"Has privilege consent - Tooltip": "如果为假则禁止为built-in组织新增用户",
"Has privilege consent warning": "目前,向'built-in'组织添加新用户的功能已禁用。请注意:'built-in'组织中的所有用户均为Casdoor的全局管理员。请参阅文档https://casdoor.org/docs/basic/core-concepts#how-does-casdoor-manage-itself。如果您仍希望为'built-in'组织创建用户,请转到该组织的设置页面并启用“特权同意”选项。",
"Init score": "初始积分",
"Init score - Tooltip": "用户注册后所拥有的初始积分",
"Is profile public": "是否公开用户个人页",