|
|
|
Re: Instance level permissions [message #1863957 is a reply to message #1863948] |
Fri, 08 March 2024 06:44 |
Ed Merks Messages: 33251 Registered: July 2009 |
Senior Member |
|
|
Of course you realize that "certain permissions" is not very clear. Somewhere in your logic you are collecting the Person objects to present them to the user; you can filter things there. Deleting implies removing them from a container object, but you've not described that part of your model. The container's item provider will be called for createRemoveCommand; you can override that method to return an UnexecutableCommand.INSTANCE for some Persons. Some things seem trickier. When a person is created, the age is not yet determined so how can you prevent creation of a Person of indeterminate age? My original answer was focused on the "permissions" for modifying of the attributes, presumably by the properties view, which is done via the property descriptors which you can specialize to make them read only or filter them be not visible.
In general my advice would be to use the debugger to see the call stack when the thing you want to restrict happens so that you see where along that chain you can specialize the code to behave differently.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02487 seconds