diff --git a/controllers/account.go b/controllers/account.go
index e80c9ca4..5da7ee36 100644
--- a/controllers/account.go
+++ b/controllers/account.go
@@ -18,6 +18,7 @@ import (
"encoding/json"
"fmt"
"strconv"
+ "strings"
"github.com/casdoor/casdoor/object"
"github.com/casdoor/casdoor/util"
@@ -172,6 +173,13 @@ func (c *ApiController) Signup() {
Karma: 0,
}
+ if len(organization.Tags) > 0 {
+ tokens := strings.Split(organization.Tags[0], "|")
+ if len(tokens) > 0 {
+ user.Tag = tokens[0]
+ }
+ }
+
if application.GetSignupItemRule("Display name") == "First, last" {
if form.FirstName != "" || form.LastName != "" {
user.DisplayName = fmt.Sprintf("%s %s", form.FirstName, form.LastName)
diff --git a/object/init.go b/object/init.go
index c0363ba3..52d07106 100644
--- a/object/init.go
+++ b/object/init.go
@@ -47,9 +47,10 @@ func initBuiltInOrganization() {
DisplayName: "Built-in Organization",
WebsiteUrl: "https://example.com",
Favicon: "https://cdn.casbin.com/static/favicon.ico",
+ PasswordType: "plain",
PhonePrefix: "86",
DefaultAvatar: "https://casbin.org/img/casbin.svg",
- PasswordType: "plain",
+ Tags: []string{},
}
AddOrganization(organization)
}
diff --git a/object/organization.go b/object/organization.go
index b9b6bb86..0c903ddd 100644
--- a/object/organization.go
+++ b/object/organization.go
@@ -25,15 +25,16 @@ type Organization struct {
Name string `xorm:"varchar(100) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
- DisplayName string `xorm:"varchar(100)" json:"displayName"`
- WebsiteUrl string `xorm:"varchar(100)" json:"websiteUrl"`
- Favicon string `xorm:"varchar(100)" json:"favicon"`
- PasswordType string `xorm:"varchar(100)" json:"passwordType"`
- PasswordSalt string `xorm:"varchar(100)" json:"passwordSalt"`
- PhonePrefix string `xorm:"varchar(10)" json:"phonePrefix"`
- DefaultAvatar string `xorm:"varchar(100)" json:"defaultAvatar"`
- MasterPassword string `xorm:"varchar(100)" json:"masterPassword"`
- EnableSoftDeletion bool `json:"enableSoftDeletion"`
+ DisplayName string `xorm:"varchar(100)" json:"displayName"`
+ WebsiteUrl string `xorm:"varchar(100)" json:"websiteUrl"`
+ Favicon string `xorm:"varchar(100)" json:"favicon"`
+ PasswordType string `xorm:"varchar(100)" json:"passwordType"`
+ PasswordSalt string `xorm:"varchar(100)" json:"passwordSalt"`
+ PhonePrefix string `xorm:"varchar(10)" json:"phonePrefix"`
+ DefaultAvatar string `xorm:"varchar(100)" json:"defaultAvatar"`
+ Tags []string `xorm:"mediumtext" json:"tags"`
+ MasterPassword string `xorm:"varchar(100)" json:"masterPassword"`
+ EnableSoftDeletion bool `json:"enableSoftDeletion"`
}
func GetOrganizationCount(owner, field, value string) int {
diff --git a/web/src/OrganizationEditPage.js b/web/src/OrganizationEditPage.js
index 45b21cf9..d892e0f7 100644
--- a/web/src/OrganizationEditPage.js
+++ b/web/src/OrganizationEditPage.js
@@ -208,6 +208,18 @@ class OrganizationEditPage extends React.Component {
+
+
+ {Setting.getLabel(i18next.t("organization:Tags"), i18next.t("organization:Tags - Tooltip"))} :
+
+
+
+
+
{Setting.getLabel(i18next.t("general:Master password"), i18next.t("general:Master password - Tooltip"))} :
diff --git a/web/src/OrganizationListPage.js b/web/src/OrganizationListPage.js
index 1ba321cc..ad8354c2 100644
--- a/web/src/OrganizationListPage.js
+++ b/web/src/OrganizationListPage.js
@@ -36,6 +36,7 @@ class OrganizationListPage extends BaseListPage {
PasswordSalt: "",
phonePrefix: "86",
defaultAvatar: "https://casbin.org/img/casbin.svg",
+ tags: [],
masterPassword: "",
enableSoftDeletion: false,
}
diff --git a/web/src/UserEditPage.js b/web/src/UserEditPage.js
index 77b54425..80a6b2da 100644
--- a/web/src/UserEditPage.js
+++ b/web/src/UserEditPage.js
@@ -301,9 +301,24 @@ class UserEditPage extends React.Component {
{Setting.getLabel(i18next.t("user:Tag"), i18next.t("user:Tag - Tooltip"))} :
- {
- this.updateUserField('tag', e.target.value);
- }} />
+ {
+ this.state.application?.organizationObj.tags?.length > 0 ? (
+
+ ) : (
+ {
+ this.updateUserField('tag', e.target.value);
+ }} />
+ )
+ }
diff --git a/web/src/locales/de/data.json b/web/src/locales/de/data.json
index 61f8dab1..3fa3c78e 100644
--- a/web/src/locales/de/data.json
+++ b/web/src/locales/de/data.json
@@ -249,6 +249,8 @@
"New Organization": "New Organization",
"Soft deletion": "Weiche Löschung",
"Soft deletion - Tooltip": "Weiche Löschung - Tooltip",
+ "Tags": "Tags",
+ "Tags - Tooltip": "Tags - Tooltip",
"Website URL": "Website-URL",
"Website URL - Tooltip": "Unique string-style identifier"
},
diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json
index c5fcb330..5c61aa4e 100644
--- a/web/src/locales/en/data.json
+++ b/web/src/locales/en/data.json
@@ -249,6 +249,8 @@
"New Organization": "New Organization",
"Soft deletion": "Soft deletion",
"Soft deletion - Tooltip": "Soft deletion - Tooltip",
+ "Tags": "Tags",
+ "Tags - Tooltip": "Tags - Tooltip",
"Website URL": "Website URL",
"Website URL - Tooltip": "Website URL - Tooltip"
},
diff --git a/web/src/locales/fr/data.json b/web/src/locales/fr/data.json
index 10703a75..d34fd052 100644
--- a/web/src/locales/fr/data.json
+++ b/web/src/locales/fr/data.json
@@ -249,6 +249,8 @@
"New Organization": "New Organization",
"Soft deletion": "Suppression du logiciel",
"Soft deletion - Tooltip": "Suppression de soft - infobulle",
+ "Tags": "Tags",
+ "Tags - Tooltip": "Tags - Tooltip",
"Website URL": "URL du site web",
"Website URL - Tooltip": "Unique string-style identifier"
},
diff --git a/web/src/locales/ja/data.json b/web/src/locales/ja/data.json
index f18fcf28..f964eac8 100644
--- a/web/src/locales/ja/data.json
+++ b/web/src/locales/ja/data.json
@@ -249,6 +249,8 @@
"New Organization": "New Organization",
"Soft deletion": "ソフト削除",
"Soft deletion - Tooltip": "ソフト削除 - ツールチップ",
+ "Tags": "Tags",
+ "Tags - Tooltip": "Tags - Tooltip",
"Website URL": "Website URL",
"Website URL - Tooltip": "Unique string-style identifier"
},
diff --git a/web/src/locales/ko/data.json b/web/src/locales/ko/data.json
index 6a5e11d4..e499bfad 100644
--- a/web/src/locales/ko/data.json
+++ b/web/src/locales/ko/data.json
@@ -249,6 +249,8 @@
"New Organization": "New Organization",
"Soft deletion": "Soft deletion",
"Soft deletion - Tooltip": "Soft deletion - Tooltip",
+ "Tags": "Tags",
+ "Tags - Tooltip": "Tags - Tooltip",
"Website URL": "Website URL",
"Website URL - Tooltip": "Unique string-style identifier"
},
diff --git a/web/src/locales/ru/data.json b/web/src/locales/ru/data.json
index f0866bb7..37ebec1d 100644
--- a/web/src/locales/ru/data.json
+++ b/web/src/locales/ru/data.json
@@ -249,6 +249,8 @@
"New Organization": "New Organization",
"Soft deletion": "Мягкое удаление",
"Soft deletion - Tooltip": "Мягкое удаление - Подсказка",
+ "Tags": "Tags",
+ "Tags - Tooltip": "Tags - Tooltip",
"Website URL": "URL сайта",
"Website URL - Tooltip": "Unique string-style identifier"
},
diff --git a/web/src/locales/zh/data.json b/web/src/locales/zh/data.json
index 8c26ef3a..e3f35017 100644
--- a/web/src/locales/zh/data.json
+++ b/web/src/locales/zh/data.json
@@ -249,6 +249,8 @@
"New Organization": "添加组织",
"Soft deletion": "软删除",
"Soft deletion - Tooltip": "启用后,删除用户信息时不会在数据库彻底清除,只会标记为已删除状态",
+ "Tags": "标签集合",
+ "Tags - Tooltip": "可供用户选择的标签的集合",
"Website URL": "网页地址",
"Website URL - Tooltip": "网页地址"
},