Browse Source

make required policy optional

pull/5890/head
Ilkay Ilknur 6 years ago
parent
commit
b1d622ea02
  1. 7
      framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs

7
framework/src/Volo.Abp.BlazoriseUI/Components/EntityAction.razor.cs

@ -11,7 +11,7 @@ namespace Volo.Abp.BlazoriseUI.Components
{ {
public partial class EntityAction<TItem> : ComponentBase public partial class EntityAction<TItem> : ComponentBase
{ {
internal bool IsVisible; internal bool IsVisible = true;
[Parameter] [Parameter]
public string Text { get; set; } public string Text { get; set; }
@ -44,7 +44,10 @@ namespace Volo.Abp.BlazoriseUI.Components
{ {
await base.OnInitializedAsync(); await base.OnInitializedAsync();
await SetDefaultValuesAsync(); await SetDefaultValuesAsync();
IsVisible = await AuthorizationService.IsGrantedAsync(RequiredPolicy); if (!RequiredPolicy.IsNullOrEmpty())
{
IsVisible = await AuthorizationService.IsGrantedAsync(RequiredPolicy);
}
ParentActions.AddAction(this); ParentActions.AddAction(this);
} }

Loading…
Cancel
Save