Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
5943385d
Unverified
Commit
5943385d
authored
Jun 09, 2023
by
Columbus
Committed by
GitHub
Jun 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: the bug that allows regular users to add unregistered users to the workspace. (#328)
parent
0abd6728
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
account_service.py
api/services/account_service.py
+5
-3
No files found.
api/services/account_service.py
View file @
5943385d
...
@@ -267,9 +267,10 @@ class TenantService:
...
@@ -267,9 +267,10 @@ class TenantService:
}
}
if
action
not
in
[
'add'
,
'remove'
,
'update'
]:
if
action
not
in
[
'add'
,
'remove'
,
'update'
]:
raise
InvalidActionError
(
"Invalid action."
)
raise
InvalidActionError
(
"Invalid action."
)
if
operator
.
id
==
member
.
id
:
if
member
:
raise
CannotOperateSelfError
(
"Cannot operate self."
)
if
operator
.
id
==
member
.
id
:
raise
CannotOperateSelfError
(
"Cannot operate self."
)
ta_operator
=
TenantAccountJoin
.
query
.
filter_by
(
ta_operator
=
TenantAccountJoin
.
query
.
filter_by
(
tenant_id
=
tenant
.
id
,
tenant_id
=
tenant
.
id
,
...
@@ -365,6 +366,7 @@ class RegisterService:
...
@@ -365,6 +366,7 @@ class RegisterService:
account
=
Account
.
query
.
filter_by
(
email
=
email
)
.
first
()
account
=
Account
.
query
.
filter_by
(
email
=
email
)
.
first
()
if
not
account
:
if
not
account
:
TenantService
.
check_member_permission
(
tenant
,
inviter
,
None
,
'add'
)
name
=
email
.
split
(
'@'
)[
0
]
name
=
email
.
split
(
'@'
)[
0
]
account
=
AccountService
.
create_account
(
email
,
name
)
account
=
AccountService
.
create_account
(
email
,
name
)
account
.
status
=
AccountStatus
.
PENDING
.
value
account
.
status
=
AccountStatus
.
PENDING
.
value
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment