-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21228e1
commit 7a32fe7
Showing
2 changed files
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* @Author: [email protected] | ||
* @Date: 2022-12-02 16:53:23 | ||
* @LastEditors: [email protected] | ||
* @LastEditTime: 2023-01-13 11:44:40 | ||
* @LastEditTime: 2024-09-20 10:51:35 | ||
* @Description: | ||
*/ | ||
"use strict"; | ||
|
@@ -190,7 +190,7 @@ module.exports = { | |
return; | ||
} | ||
|
||
let profile = 'user'; | ||
let profile = process.env.STEEDOS_TENANT_REGISTER_DEFAULT_PROFILE || 'user'; | ||
|
||
const space = await spaceObj.findOne(spaceId, { fields: ['default_profile', 'default_organization'] }) | ||
if (space) { | ||
|
@@ -202,6 +202,10 @@ module.exports = { | |
} | ||
} | ||
|
||
if(process.env.STEEDOS_TENANT_REGISTER_PROFILE ){ | ||
profile = process.env.STEEDOS_TENANT_REGISTER_PROFILE; | ||
} | ||
|
||
if (!organization_id) { | ||
const rootOrg = (await orgObj.find({ | ||
filters: [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* @Author: [email protected] | ||
* @Date: 2022-12-07 14:19:57 | ||
* @LastEditors: [email protected] | ||
* @LastEditTime: 2024-09-09 17:42:29 | ||
* @LastEditTime: 2024-09-20 10:43:52 | ||
* @Description: | ||
*/ | ||
"use strict"; | ||
|
@@ -401,7 +401,7 @@ module.exports = { | |
} | ||
if (doc.profile) { | ||
const isSpaceOwner = await broker.call('spaces.isSpaceOwner', { spaceId: doc.space, userId: userId }) | ||
if (doc.profile === 'admin' && !isSpaceOwner) { | ||
if (doc.profile === 'admin' && !isSpaceOwner && this.userId) { | ||
throw new Error("Only the administrator can set the profile to admin"); | ||
} | ||
} else { | ||
|