mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-465 Restrict edit own roles
This commit is contained in:
+3
@@ -167,6 +167,9 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
if (grantor == null) {
|
||||
throw new DBWebException("Cannot grant role in anonymous mode");
|
||||
}
|
||||
if (CommonUtils.equalObjects(user, webSession.getUser().getUserId())) {
|
||||
throw new DBWebException("You cannot edit your own permissions");
|
||||
}
|
||||
try {
|
||||
WebRole[] userRoles = CBPlatform.getInstance().getApplication().getSecurityController().getUserRoles(user);
|
||||
List<String> roleIds = Arrays.stream(userRoles).map(WebRole::getRoleId).collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user