I know how to create roles and assign roles to the Grid view & Add views.
However I'm struggling to see how I can create a role such as 'ViewOnly' where a user in that role can see the grid list, but is prevented from Editing or Deleting actions on the grid view.
Am I missing something?
Do I need to implement by way of policy?
the only way I could find was to use the partial class technique and implement for
partial void OnSomeTypeDeleted(...)
However, this won't work for me as I cannot inject the SecurityService (which I need) in order to check if the user is in a particular Role so back to square one...
There are two partial methods for this purpose. However reversing a delete seems as a big overhead. Ideally you should not invoke the delete operation unless the user can do so. Use the Condition property of the Invoke data source action or hide the Delete button altogether.
I think the second partial method is too late - the changes are commited by then.
I can only use the first partial if I go down that route - and that can't undo the delete so pretty much no useful either.
There seems to be no ref handle set a visible property on (which to be honest is easily circumvented so not my choice unless no other).
You mentioned "Use the Condition property of the Invoke data source action..."
When you say "template" do you mean editing this file?
I thought that would be generated so lose any changes I make to it?
It appears not to so that was surprising...so if I add another column to my data source and hit "infer" - will the grid change then? will this not in turn remove my custom changes?
Cheers, got it!
Suggest there has to be a more succint way for such a common scenario esp for CRUD apps
Appreciate the prompt support all the same
Cheers,
John (WA, Australia)