mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-01 10:00:19 +08:00
feat: support shared application across organizations (#3108)
* feat: support share application * revert: revert i18n * fix: improve code format * fix: improve code format and move GetSharedOrgFromApp to string.go
This commit is contained in:
@ -154,6 +154,16 @@ func GetOwnerAndNameAndOtherFromId(id string) (string, string, string) {
|
||||
return tokens[0], tokens[1], tokens[2]
|
||||
}
|
||||
|
||||
func GetSharedOrgFromApp(rawName string) (name string, organization string) {
|
||||
name = rawName
|
||||
splitName := strings.Split(rawName, "-org-")
|
||||
if len(splitName) >= 2 {
|
||||
organization = splitName[len(splitName)-1]
|
||||
name = splitName[0]
|
||||
}
|
||||
return name, organization
|
||||
}
|
||||
|
||||
func GenerateId() string {
|
||||
return uuid.NewString()
|
||||
}
|
||||
|
Reference in New Issue
Block a user