Add restriction to built-in org and app modification.

This commit is contained in:
Yang Luo
2021-12-23 00:40:07 +08:00
parent 8345295d0c
commit f5bc76016d
6 changed files with 22 additions and 4 deletions

View File

@ -112,6 +112,10 @@ func UpdateOrganization(id string, organization *Organization) bool {
return false
}
if name == "built-in" {
organization.Name = name
}
if organization.MasterPassword != "" {
credManager := cred.GetCredManager(organization.PasswordType)
if credManager != nil {
@ -138,6 +142,10 @@ func AddOrganization(organization *Organization) bool {
}
func DeleteOrganization(organization *Organization) bool {
if organization.Name == "built-in" {
return false
}
affected, err := adapter.Engine.ID(core.PK{organization.Owner, organization.Name}).Delete(&Organization{})
if err != nil {
panic(err)