-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Show an error message if permission names are not unique #17385
base: main
Are you sure you want to change the base?
Conversation
@gvkries I don't think throwing an exception is the right approach here. Instead, I would recommend logging a warning and proceeding. Imagine a scenario where a developer creates a module that exposes a permission named Since permissions are string-based, such naming conflicts are acceptable to some extent, but they should still trigger a warning to notify developers. However, I don’t think it’s appropriate to throw an exception that would stop the application from running entirely. |
I understand the concern about breaking existing applications, but the security implications of reusing permission names are significant:
While the current solution only causes the admin portal to fail, it highlights the issue and prompts immediate action. Given the high stakes, enforcing an exception is necessary to maintain application security. |
I understand the concert. This is something I also mentioned few weeks back in the meeting. But I don't think its a justification for throwing a runtime exception. I think logging it as a warning is enough unless we need to try to use namespace to ensure uniqueness which is also bad since it would increase the cookie size. |
Okay, instead of throwing an exception, I'm content to show an error in the admin portal. I think that the mere logging has too little visibility. I also admit that the previous solution was not sufficient because throwing an exception in the |
Note: Changing the permission names to include the module name or namespace is not an easy solution. This would be a massive breaking change IMHO. |
Yes I agree. I am not suggesting that either. I think we should log warning and not throw an exception. |
@MikeAlhayek Maybe we can briefly talk about this tomorrow. |
Absolutely |
Currently, permission names are expected to be unique across all modules. This change displays an error message in the Role Editor when a permission name is reused. This alerts the administrator to possible security issues when a module redefines an existing permission.
Fixes #8469