updated namespaces, improved page management,
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
@using Oqtane.Shared
|
||||
@using Oqtane.Security
|
||||
@using System.Linq
|
||||
@namespace Oqtane.Shared
|
||||
@inject IUserService UserService
|
||||
@inject IModuleService ModuleService
|
||||
@inject IModuleDefinitionService ModuleDefinitionService
|
||||
@ -66,8 +67,8 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
// verify security access level for this module control
|
||||
switch (module.SecurityAccessLevel)
|
||||
// verify security access level for this module control
|
||||
switch (module.SecurityAccessLevel)
|
||||
{
|
||||
case SecurityAccessLevel.Anonymous:
|
||||
authorized = true;
|
||||
@ -99,8 +100,8 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
// module control does not exist with name specified
|
||||
}
|
||||
// module control does not exist with name specified
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -111,8 +112,8 @@
|
||||
Module module = PageState.Modules.Where(item => item.ModuleId == PageState.ModuleId).FirstOrDefault();
|
||||
if (module != null && module.Pane == Name)
|
||||
{
|
||||
// check if user is authorized to view module
|
||||
if (UserSecurity.IsAuthorized(PageState.User, "View", module.Permissions))
|
||||
// check if user is authorized to view module
|
||||
if (UserSecurity.IsAuthorized(PageState.User, "View", module.Permissions))
|
||||
{
|
||||
builder.OpenComponent(0, Type.GetType(Constants.DefaultContainer));
|
||||
builder.AddAttribute(1, "Module", module);
|
||||
@ -124,8 +125,8 @@
|
||||
{
|
||||
foreach (Module module in PageState.Modules.Where(item => item.Pane == Name).OrderBy(x => x.Order).ToArray())
|
||||
{
|
||||
// check if user is authorized to view module
|
||||
if (UserSecurity.IsAuthorized(PageState.User, "View", module.Permissions))
|
||||
// check if user is authorized to view module
|
||||
if (UserSecurity.IsAuthorized(PageState.User, "View", module.Permissions))
|
||||
{
|
||||
builder.OpenComponent(0, Type.GetType(Constants.DefaultContainer));
|
||||
builder.AddAttribute(1, "Module", module);
|
||||
|
Reference in New Issue
Block a user