Skip to content

Commit

Permalink
Merge pull request #3205 from sbwalker/dev
Browse files Browse the repository at this point in the history
filter deleted pages and modules on the server
  • Loading branch information
sbwalker authored Aug 28, 2023
2 parents b713cf8 + db2c42f commit ad57d66
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Oqtane.Client/UI/PageState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public class PageState

public List<Page> Pages
{
get { return Site.Pages.Where(item => !item.IsDeleted).ToList(); }
get { return Site.Pages; }
}
public List<Module> Modules
{
get { return Site.Modules.Where(item => !item.IsDeleted).ToList(); }
get { return Site.Modules; }
}
public List<Language> Languages
{
Expand Down
2 changes: 1 addition & 1 deletion Oqtane.Client/UI/SiteRouter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
module.PaneModuleIndex = -1;
module.PaneModuleCount = 0;

if ((module.PageId == page.PageId || module.ModuleId == moduleid))
if (module.PageId == page.PageId || module.ModuleId == moduleid)
{
var typename = Constants.ErrorModule;

Expand Down
4 changes: 2 additions & 2 deletions Oqtane.Server/Controllers/SiteController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private Site GetSite(int siteid)
site.Pages = new List<Page>();
foreach (Page page in _pages.GetPages(site.SiteId))
{
if (_userPermissions.IsAuthorized(User, PermissionNames.View, page.PermissionList))
if (!page.IsDeleted && _userPermissions.IsAuthorized(User, PermissionNames.View, page.PermissionList))
{
page.Settings = settings.Where(item => item.EntityId == page.PageId)
.Where(item => !item.IsPrivate || _userPermissions.IsAuthorized(User, PermissionNames.Edit, page.PermissionList))
Expand All @@ -107,7 +107,7 @@ private Site GetSite(int siteid)
site.Modules = new List<Module>();
foreach (PageModule pagemodule in _pageModules.GetPageModules(site.SiteId))
{
if (_userPermissions.IsAuthorized(User, PermissionNames.View, pagemodule.Module.PermissionList))
if (!pagemodule.IsDeleted && _userPermissions.IsAuthorized(User, PermissionNames.View, pagemodule.Module.PermissionList))
{
Module module = new Module();
module.SiteId = pagemodule.Module.SiteId;
Expand Down

0 comments on commit ad57d66

Please sign in to comment.