fix Swashbuckle reference, fix folder issue in installationmanager, disabled blazor linking on build
This commit is contained in:
parent
b2c44f970e
commit
00d8f17254
|
@ -47,7 +47,7 @@
|
|||
<option value="<">Before</option>
|
||||
<option value=">">After</option>
|
||||
}
|
||||
<option value=">>" selected>At End</option>
|
||||
<option value=">>">At End</option>
|
||||
</select>
|
||||
@if (children != null && children.Count > 0 && (insert == "<" || insert == ">"))
|
||||
{
|
||||
|
@ -74,12 +74,12 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Edit Mode? </label>
|
||||
<label for="Name" class="control-label">Default Mode? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@editmode">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
<select class="form-control" @bind="@mode">
|
||||
<option value="view">View Mode</option>
|
||||
<option value="edit">Edit Mode</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -145,7 +145,7 @@
|
|||
List<Page> children;
|
||||
int childid = -1;
|
||||
string isnavigation = "True";
|
||||
string editmode = "False";
|
||||
string mode = "view";
|
||||
string themetype = "";
|
||||
string layouttype = "";
|
||||
string icon = "";
|
||||
|
@ -250,7 +250,7 @@
|
|||
break;
|
||||
}
|
||||
page.IsNavigation = (isnavigation == null ? true : Boolean.Parse(isnavigation));
|
||||
page.EditMode = (editmode == null ? true : Boolean.Parse(editmode));
|
||||
page.EditMode = (mode == "edit" ? true : false);
|
||||
page.ThemeType = themetype;
|
||||
page.LayoutType = (layouttype == null ? "" : layouttype);
|
||||
page.Icon = (icon == null ? "" : icon);
|
||||
|
|
|
@ -4,104 +4,104 @@
|
|||
@inject IPageService PageService
|
||||
@inject IThemeService ThemeService
|
||||
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Name: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@name" readonly />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Path: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@path" readonly />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Parent: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@parentid" readonly>
|
||||
<option value=""><Select Parent></option>
|
||||
@foreach (Page p in PageState.Pages)
|
||||
{
|
||||
<option value="@p.PageId">@p.Name</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Navigation? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@isnavigation" readonly>
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Edit Mode? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@editmode" readonly>
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Theme: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@themetype" readonly>
|
||||
<option value=""><Select Theme></option>
|
||||
@foreach (KeyValuePair<string, string> item in themes)
|
||||
{
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Layout: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@layouttype" readonly>
|
||||
<option value=""><Select Layout></option>
|
||||
@foreach (KeyValuePair<string, string> panelayout in panelayouts)
|
||||
{
|
||||
<option value="@panelayout.Key">@panelayout.Value</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Icon: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@icon" readonly />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Permissions: </label>
|
||||
</td>
|
||||
<td>
|
||||
<PermissionGrid EntityName="Page" Permissions="@permissions" @ref="permissiongrid" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Name: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@name" readonly />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Path: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@path" readonly />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Parent: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@parentid" readonly>
|
||||
<option value=""><Select Parent></option>
|
||||
@foreach (Page p in PageState.Pages)
|
||||
{
|
||||
<option value="@p.PageId">@p.Name</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Navigation? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@isnavigation" readonly>
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Default Mode? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@mode">
|
||||
<option value="view">View Mode</option>
|
||||
<option value="edit">Edit Mode</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Theme: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@themetype" readonly>
|
||||
<option value=""><Select Theme></option>
|
||||
@foreach (KeyValuePair<string, string> item in themes)
|
||||
{
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Layout: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@layouttype" readonly>
|
||||
<option value=""><Select Layout></option>
|
||||
@foreach (KeyValuePair<string, string> panelayout in panelayouts)
|
||||
{
|
||||
<option value="@panelayout.Key">@panelayout.Value</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Icon: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@icon" readonly />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Permissions: </label>
|
||||
</td>
|
||||
<td>
|
||||
<PermissionGrid EntityName="Page" Permissions="@permissions" @ref="permissiongrid" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-danger" @onclick="DeletePage">Delete</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
<br />
|
||||
|
@ -119,7 +119,7 @@
|
|||
string path;
|
||||
string parentid = "";
|
||||
string isnavigation;
|
||||
string editmode;
|
||||
string mode;
|
||||
string themetype;
|
||||
string layouttype;
|
||||
string icon;
|
||||
|
@ -145,7 +145,7 @@
|
|||
name = page.Name;
|
||||
path = page.Path;
|
||||
isnavigation = page.IsNavigation.ToString();
|
||||
editmode = page.EditMode.ToString();
|
||||
mode = (page.EditMode) ? "edit" : "view";
|
||||
themetype = page.ThemeType;
|
||||
layouttype = page.LayoutType;
|
||||
icon = page.Icon;
|
||||
|
|
|
@ -4,141 +4,141 @@
|
|||
@inject IPageService PageService
|
||||
@inject IThemeService ThemeService
|
||||
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Name: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@name" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Path: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@path" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Parent: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @onchange="(e => ParentChanged(e))">
|
||||
<option value="-1"><Site Root></option>
|
||||
@foreach (Page page in pages)
|
||||
{
|
||||
if (page.PageId.ToString() == parentid)
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Name: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@name" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Path: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@path" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Parent: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @onchange="(e => ParentChanged(e))">
|
||||
<option value="-1"><Site Root></option>
|
||||
@foreach (Page page in pages)
|
||||
{
|
||||
<option value="@(page.PageId)" selected>@(new string('-', page.Level * 2))@(page.Name)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@(page.PageId)">@(new string('-', page.Level * 2))@(page.Name)</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Move : </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@insert">
|
||||
@if (parentid == currentparentid)
|
||||
{
|
||||
<option value=""><Maintain Current Location></option>
|
||||
}
|
||||
<option value="<<">To Beginning</option>
|
||||
@if (children != null && children.Count > 0)
|
||||
{
|
||||
<option value="<">Before</option>
|
||||
<option value=">">After</option>
|
||||
}
|
||||
<option value=">>" selected>To End</option>
|
||||
</select>
|
||||
@if (children != null && children.Count > 0 && (insert == "<" || insert == ">"))
|
||||
{
|
||||
<select class="form-control" @bind="@childid">
|
||||
<option value="-1"><Select Page></option>
|
||||
@foreach (Page page in children)
|
||||
{
|
||||
<option value="@(page.PageId)">@(page.Name)</option>
|
||||
if (page.PageId.ToString() == parentid)
|
||||
{
|
||||
<option value="@(page.PageId)" selected>@(new string('-', page.Level * 2))@(page.Name)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@(page.PageId)">@(new string('-', page.Level * 2))@(page.Name)</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Navigation? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@isnavigation">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Edit Mode? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@editmode">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Theme: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@themetype">
|
||||
<option value=""><Select Theme></option>
|
||||
@foreach (KeyValuePair<string, string> item in themes)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Move : </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@insert">
|
||||
@if (parentid == currentparentid)
|
||||
{
|
||||
<option value="="><Maintain Current Location></option>
|
||||
}
|
||||
<option value="<<">To Beginning</option>
|
||||
@if (children != null && children.Count > 0)
|
||||
{
|
||||
<option value="<">Before</option>
|
||||
<option value=">">After</option>
|
||||
}
|
||||
<option value=">>">To End</option>
|
||||
</select>
|
||||
@if (children != null && children.Count > 0 && (insert == "<" || insert == ">"))
|
||||
{
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
<select class="form-control" @bind="@childid">
|
||||
<option value="-1"><Select Page></option>
|
||||
@foreach (Page page in children)
|
||||
{
|
||||
<option value="@(page.PageId)">@(page.Name)</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Layout: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@layouttype">
|
||||
<option value=""><Select Layout></option>
|
||||
@foreach (KeyValuePair<string, string> panelayout in panelayouts)
|
||||
{
|
||||
<option value="@panelayout.Key">@panelayout.Value</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Icon: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@icon" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Permissions: </label>
|
||||
</td>
|
||||
<td>
|
||||
<PermissionGrid EntityName="Page" Permissions="@permissions" @ref="permissiongrid" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Navigation? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@isnavigation">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Default Mode? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@mode">
|
||||
<option value="view">View Mode</option>
|
||||
<option value="edit">Edit Mode</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Theme: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@themetype">
|
||||
<option value=""><Select Theme></option>
|
||||
@foreach (KeyValuePair<string, string> item in themes)
|
||||
{
|
||||
<option value="@item.Key">@item.Value</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Layout: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@layouttype">
|
||||
<option value=""><Select Layout></option>
|
||||
@foreach (KeyValuePair<string, string> panelayout in panelayouts)
|
||||
{
|
||||
<option value="@panelayout.Key">@panelayout.Value</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Icon: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@icon" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Permissions: </label>
|
||||
</td>
|
||||
<td>
|
||||
<PermissionGrid EntityName="Page" Permissions="@permissions" @ref="permissiongrid" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-success" @onclick="SavePage">Save</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
<br />
|
||||
|
@ -157,11 +157,11 @@
|
|||
string path;
|
||||
string currentparentid;
|
||||
string parentid;
|
||||
string insert = "";
|
||||
string insert = "=";
|
||||
List<Page> children;
|
||||
int childid = -1;
|
||||
string isnavigation;
|
||||
string editmode;
|
||||
string mode;
|
||||
string themetype;
|
||||
string layouttype;
|
||||
string icon;
|
||||
|
@ -203,7 +203,7 @@
|
|||
}
|
||||
currentparentid = parentid;
|
||||
isnavigation = page.IsNavigation.ToString();
|
||||
editmode = page.EditMode.ToString();
|
||||
mode = (page.EditMode) ? "edit" : "view";
|
||||
themetype = page.ThemeType;
|
||||
layouttype = page.LayoutType;
|
||||
icon = page.Icon;
|
||||
|
@ -235,7 +235,7 @@
|
|||
}
|
||||
if (parentid == currentparentid)
|
||||
{
|
||||
insert = "";
|
||||
insert = "=";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -283,7 +283,7 @@
|
|||
page.Path = parent.Path + "/" + Utilities.GetFriendlyUrl(path);
|
||||
}
|
||||
}
|
||||
if (insert != "")
|
||||
if (insert != "=")
|
||||
{
|
||||
Page child;
|
||||
switch (insert)
|
||||
|
@ -305,7 +305,7 @@
|
|||
}
|
||||
}
|
||||
page.IsNavigation = (isnavigation == null ? true : Boolean.Parse(isnavigation));
|
||||
page.EditMode = (editmode == null ? true : Boolean.Parse(editmode));
|
||||
page.EditMode = (mode == "edit" ? true : false);
|
||||
page.ThemeType = themetype;
|
||||
page.LayoutType = (layouttype == null ? "" : layouttype);
|
||||
page.Icon = (icon == null ? "" : icon);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
|
||||
<RestoreAdditionalProjectSources>
|
||||
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
|
||||
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
|
||||
|
|
|
@ -28,23 +28,21 @@ window.interop = {
|
|||
return "";
|
||||
}
|
||||
},
|
||||
addCSS: function (fileName) {
|
||||
var head = document.head;
|
||||
var link = document.createElement("link");
|
||||
|
||||
link.type = "text/css";
|
||||
link.rel = "stylesheet";
|
||||
link.href = fileName;
|
||||
|
||||
head.appendChild(link);
|
||||
addCSS: function (id, url) {
|
||||
if (document.getElementById(id) === null) {
|
||||
var link = document.createElement("link");
|
||||
link.id = id;
|
||||
link.type = "text/css";
|
||||
link.rel = "stylesheet";
|
||||
link.href = url;
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
},
|
||||
removeCSS: function (filePattern) {
|
||||
var head = document.head;
|
||||
removeCSS: function (pattern) {
|
||||
var links = document.getElementsByTagName("link");
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
var link = links[i];
|
||||
if (link.rel === 'stylesheet' && link.href.includes(filePattern)) {
|
||||
head.removeChild(link);
|
||||
if (links[i].id.includes(pattern)) {
|
||||
document.head.removeChild(links[i]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -57,7 +57,12 @@ namespace Oqtane.Infrastructure
|
|||
case ".svg":
|
||||
case ".js":
|
||||
case ".css":
|
||||
entry.ExtractToFile(folder + "\\" + entry.FullName.Replace("wwwroot", name).Replace("/","\\"), true);
|
||||
filename = folder + "\\" + entry.FullName.Replace("wwwroot", name).Replace("/", "\\");
|
||||
if (!Directory.Exists(Path.GetDirectoryName(filename)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(filename));
|
||||
}
|
||||
entry.ExtractToFile(filename, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,6 +276,16 @@ namespace Oqtane.Server
|
|||
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// register authorization services
|
||||
services.AddAuthorizationCore(options =>
|
||||
{
|
||||
options.AddPolicy("ViewPage", policy => policy.Requirements.Add(new PermissionRequirement("Page", "View")));
|
||||
options.AddPolicy("EditPage", policy => policy.Requirements.Add(new PermissionRequirement("Page", "Edit")));
|
||||
options.AddPolicy("ViewModule", policy => policy.Requirements.Add(new PermissionRequirement("Module", "View")));
|
||||
options.AddPolicy("EditModule", policy => policy.Requirements.Add(new PermissionRequirement("Module", "Edit")));
|
||||
});
|
||||
services.AddScoped<IAuthorizationHandler, PermissionHandler>();
|
||||
|
||||
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
||||
|
||||
services.AddDbContext<MasterDBContext>(options =>
|
||||
|
@ -307,15 +317,8 @@ namespace Oqtane.Server
|
|||
options.User.RequireUniqueEmail = false;
|
||||
});
|
||||
|
||||
// register authorization services
|
||||
services.AddAuthorizationCore(options =>
|
||||
{
|
||||
options.AddPolicy("ViewPage", policy => policy.Requirements.Add(new PermissionRequirement("Page", "View")));
|
||||
options.AddPolicy("EditPage", policy => policy.Requirements.Add(new PermissionRequirement("Page", "Edit")));
|
||||
options.AddPolicy("ViewModule", policy => policy.Requirements.Add(new PermissionRequirement("Module", "View")));
|
||||
options.AddPolicy("EditModule", policy => policy.Requirements.Add(new PermissionRequirement("Module", "Edit")));
|
||||
});
|
||||
services.AddScoped<IAuthorizationHandler, PermissionHandler>();
|
||||
services.AddAuthentication(IdentityConstants.ApplicationScheme)
|
||||
.AddCookie(IdentityConstants.ApplicationScheme);
|
||||
|
||||
services.ConfigureApplicationCookie(options =>
|
||||
{
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 7.8 KiB |
Loading…
Reference in New Issue
Block a user