Enhance tab authorization with role and permission checks #5872
Add RoleName and PermissionName parameters to TabPanel for fine-grained tab visibility control. Update IsAuthorized logic in TabStrip to prioritize Host/Admin access, then check SecurityAccessLevel, and additionally require specified roles or permissions if provided. Removes redundant Admin/Host checks from the switch statement for clarity.
This commit is contained in:
@ -30,6 +30,12 @@ else
|
||||
[Parameter]
|
||||
public SecurityAccessLevel? Security { get; set; } // optional - can be used to specify SecurityAccessLevel
|
||||
|
||||
[Parameter]
|
||||
public string RoleName { get; set; } // optional - can be used to specify Role allowed to view this tab
|
||||
|
||||
[Parameter]
|
||||
public string PermissionName { get; set; } // optional - can be used to specify Permission allowed to view this tab
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
base.OnParametersSet();
|
||||
|
||||
Reference in New Issue
Block a user