notification service and user management improvements
This commit is contained in:
@ -50,10 +50,14 @@
|
||||
[Parameter]
|
||||
public string Class { get; set; } // optional
|
||||
|
||||
[Parameter]
|
||||
public string EditMode { get; set; } // optional - specifies if a user must be in edit mode to see the action - default is true
|
||||
|
||||
[Parameter]
|
||||
public Action OnClick { get; set; } // required if an Action is specified - executes a method in the calling component
|
||||
|
||||
bool visible = false;
|
||||
bool editmode = true;
|
||||
bool authorized = false;
|
||||
|
||||
protected override void OnParametersSet()
|
||||
@ -66,13 +70,17 @@
|
||||
{
|
||||
Class = "btn btn-success";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(EditMode))
|
||||
{
|
||||
editmode = bool.Parse(EditMode);
|
||||
}
|
||||
authorized = IsAuthorized();
|
||||
}
|
||||
|
||||
private bool IsAuthorized()
|
||||
{
|
||||
bool authorized = false;
|
||||
if (PageState.EditMode)
|
||||
if (PageState.EditMode || !editmode)
|
||||
{
|
||||
SecurityAccessLevel security = SecurityAccessLevel.Host;
|
||||
if (Security == null)
|
||||
|
@ -26,11 +26,15 @@
|
||||
[Parameter]
|
||||
public string Style { get; set; } // optional
|
||||
|
||||
[Parameter]
|
||||
public string EditMode { get; set; } // optional - specifies if a user must be in edit mode to see the action - default is true
|
||||
|
||||
string text = "";
|
||||
string url = "";
|
||||
string parameters = "";
|
||||
string classname = "btn btn-primary";
|
||||
string style = "";
|
||||
bool editmode = true;
|
||||
bool authorized = false;
|
||||
|
||||
protected override void OnParametersSet()
|
||||
@ -56,6 +60,11 @@
|
||||
style = Style;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(EditMode))
|
||||
{
|
||||
editmode = bool.Parse(EditMode);
|
||||
}
|
||||
|
||||
url = EditUrl(Action, parameters);
|
||||
authorized = IsAuthorized();
|
||||
}
|
||||
@ -63,7 +72,7 @@
|
||||
private bool IsAuthorized()
|
||||
{
|
||||
bool authorized = false;
|
||||
if (PageState.EditMode)
|
||||
if (PageState.EditMode || !editmode)
|
||||
{
|
||||
SecurityAccessLevel security = SecurityAccessLevel.Host;
|
||||
if (Security == null)
|
||||
|
@ -13,6 +13,10 @@
|
||||
@foreach (var item in ItemList)
|
||||
{
|
||||
<tr>@Row(item)</tr>
|
||||
@if (Detail != null)
|
||||
{
|
||||
<tr>@Detail(item)</tr>
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@ -24,6 +28,10 @@
|
||||
@foreach (var item in ItemList)
|
||||
{
|
||||
<div class="row">@Row(item)</div>
|
||||
@if (Detail != null)
|
||||
{
|
||||
<div class="row">@Detail(item)</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@ -72,6 +80,9 @@
|
||||
[Parameter]
|
||||
public RenderFragment<TableItem> Row { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment<TableItem> Detail { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public IEnumerable<TableItem> Items { get; set; }
|
||||
|
||||
|
Reference in New Issue
Block a user