Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(user): prevent deletion of the last admin user #145

Merged
merged 2 commits into from
Oct 13, 2024

Conversation

a981008
Copy link
Contributor

@a981008 a981008 commented Oct 10, 2024

feat(user): 禁止删除最后一个管理员用户

增加了检查被删除用户是否是唯一管理员的逻辑。当删除的用户为管理员时,再判断是否为唯一管理员,如果是则不允许删除。
至少保证还有一名管理员用户,避免误删除。

BREAKING CHANGE: 尝试删除最后一个管理员现在返回一个错误
并防止操作。

Refs #34

Added logic to check if the user being deleted is the only admin. If the user
is an admin, the system will further check if they are the last admin. If so,
the deletion is disallowed to ensure at least one admin remains in the system.

BREAKING CHANGE: Attempting to delete the last admin now returns an error
and prevents the operation.

Refs nacos-group#34
@heqingpan
Copy link
Collaborator

代码看了一遍没什么问题,验证通过后,会当做本周发布内容在周末发布一个版本。

@heqingpan heqingpan merged commit dc8b895 into nacos-group:master Oct 13, 2024
6 checks passed
@heqingpan
Copy link
Collaborator

heqingpan commented Oct 13, 2024

已合并代码。
部分代码没有处理cargo fmtcargo clippy的问题;已在我本地处理。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants