Other people provided good answers with an informed suggestion to avoid hiding elements and instead turn them off and give some clues for reasons.
So, I would like to look at it from different points of view - but how to hide some elements of the user interface in cases where the user does not need to see them, regardless of whether or not he has rights to certain actions associated with the elements
For example, suppose users of a role are granted access to seller records in the system.
But then the business analyst says: “Listen, this form has a drop-down list of sellers, and we should not allow some specific roles to see it.”
The developer asks: "So, we just removed the permission of the" Sellers "from this role, right?" But the analyst replies: “No! This role should still be able to view sellers on the Sellers page. It's just this one form where we have to hide the list for some roles and show it to other roles.”
So, the developer adds a permission called the X seller’s drop-down list.
We have a problem. Access to the same data is controlled by two separate permissions. Now we need to figure out how to combine them. And what if there are several forms where the list of sellers should be hidden for some roles? How do we combine it with Read Seller List? For us developers, it’s somewhat clear that the “Read” permission should have a higher priority than “View”, so even if the user can “view” the list, he still should not see it (or see empty or disabled using a useful tip ) if he does not have permission to "Read". Developers and system analysts know this. But how does the system administrator know this? Should we teach him this? How can we guarantee that the administrator will not confuse all these "View" and "Read" for a single list of data?
As you can see, all this becomes messy for one reason - we mix data processing permissions with the user interface amenities in the list of role permissions.
I saw many projects where it becomes messy because server-side permissions are too closely related to the user interface, which poses problems and possible security holes (because you have several elements in the role resolution editor for the same actions on the same data).
Permissions relate to access and operations with some specific data. The user interface can react uniformly to permissions for the entire system (turning off prompts, hiding, etc.). We should never invent new permission entries for user interface purposes only.
Now the question remains - but how do we actually hide the user interface elements for some users of the system so as not to overload them with a huge number of elements that are always disabled? One solution might be a workspace. If we clearly know that users of a role will never need access to some specific data, we create a set of user interface controls, like permissions, but this time we do not call them permissions. And we can really truly imagine ourselves, even allowing users to customize their workspace and choose what they may or may not see. Of course, permissions will always have the highest priority, but this will only affect the data and state of the user interface elements, not visibility.
These are my two cents. Unfortunately, I myself did not work on such a system where the permissions and parameters of the user interface workspace are neatly separated, because I always start the project so late when the "damage has been done." But I hope that someday I will have a chance. I just hope to find a good example of how to do it right, but somehow Internet search does not give me anything useful. Does this mean that no one has come to the same conclusions as me? I do not believe that anyone in the world of enterprise design patterns should have noticed that this UI impedance impedance is a long time ago.