I have a WindowController that is targeting WindowType.Main in order to hide navigation items based on security permissions. It contains:[C#]
bool permission = SecuritySystem.IsGranted( new ClientPermissionRequest(typeof(Employee), null, null, SecurityOperations.Read));
While using version 15.1.3 (which was installed for only a few hours) I was seeing a compiler warning saying that ClientPermissionRequest was obsolete and I should instead use PermissionRequest. I am now using 15.1.4 but no longer seeing that warning. Is that method obsolete or not?
If ClientPermissionRequest is obsolete, how can I test permissions? When I attempted to use PermissionRequest I found that all three overloads have an ObjectSpace parameter, but there is no ObjectSpace property available in a WindowController.
The ClientPermissionRequest class is marked with the Obsolete attribute in 15.2.4. It is unclear why you do not see a warning - probably there is a Visual Studio issue.
Use the PermissionRequest class to test permissions. The only required parameters of its constructor are objectType and operation. If you want to test type permissions, use these parameters. Passing an Object Space instance is not required. If you need to test permissions for a certain object, pass the Object Space by which this object was loaded.
Please see an example in the Access the Security System in Code topic:
Please let me know if you need further assistance.