2
Hello Rajesh,
Instead of session variables, you can use Role-based Authorization and Authentication provided by Microsoft and its in-build functionality you can use.
To Hide/Show buttons in UI you can use View-based authorization. it is a sub-part of Role-based Authorization and Authentication.
Check this link
https://learn.microsoft.com/en-us/aspnet/core/security/authorization/views?view=aspnetcore-7.0
below is the sample code to hide/show button
@if ((await AuthorizationService.AuthorizeAsync(User, Model, Operations.Edit)).Succeeded)
{
<p><a class="btn btn-default" role="button"
href="@Url.Action("Edit", "Document", new { id = Model.Id })">Edit</a></p>
}
Thanks
1
I would suggest creating a dynamic button(s) based on user-level access.
For instance, from the backend you will have role-based actions, the actions may be submit/view/edit. This action button supposes to be rendered dynamically with some generic button handler. So in future, if you want to add some more action, you can define it in the backend.
From UI POV just need to call the function to render action buttons, which internally calls and creates action buttons accordingly.
I hope it gives some idea. Thanks
0
Thanks Vishal & Aravind!
When I said role based, I was referring to roles inherited from Oracle EBS environments. Regardless, I think I got an idea about how to proceed.
Other than enabling and disabling controls, I have to share some information across razor pages. Got additional suggestions?
Thanks guys :)) ??