Modified Logic from || to &&
UserSecurity.IsAuthorized && Utilities.IsPageModuleVisible fixed
This commit is contained in:
parent
22e4e4efc1
commit
8b41a03080
|
@ -262,41 +262,48 @@
|
||||||
if (page != null)
|
if (page != null)
|
||||||
{
|
{
|
||||||
// check if user is authorized to view page
|
// check if user is authorized to view page
|
||||||
if ((Utilities.IsPageModuleVisible(page.EffectiveDate, page.ExpiryDate) || UserSecurity.IsAuthorized(user, PermissionNames.Edit, page.PermissionList)) || UserSecurity.IsAuthorized(user, PermissionNames.View, page.PermissionList))
|
if (UserSecurity.IsAuthorized(user, PermissionNames.View, page.PermissionList) && (Utilities.IsPageModuleVisible(page.EffectiveDate, page.ExpiryDate) || UserSecurity.IsAuthorized(user, PermissionNames.Edit, page.PermissionList)))
|
||||||
|
//if ((Utilities.IsPageModuleVisible(page.EffectiveDate, page.ExpiryDate) || UserSecurity.IsAuthorized(user, PermissionNames.Edit, page.PermissionList)) || UserSecurity.IsAuthorized(user, PermissionNames.View, page.PermissionList))
|
||||||
{
|
{
|
||||||
// if (UserSecurity.IsAuthorized(user, PermissionNames.Edit, page.PermissionList) || Utilities.ValidateEffectiveExpiryDates(page.EffectiveDate, page.ExpiryDate))
|
// load additional metadata for current page
|
||||||
// {
|
page = ProcessPage(page, site, user, SiteState.Alias);
|
||||||
// load additional metadata for current page
|
|
||||||
page = ProcessPage(page, site, user, SiteState.Alias);
|
|
||||||
|
|
||||||
// load additional metadata for modules
|
// load additional metadata for modules
|
||||||
(page, site.Modules) = ProcessModules(page, site.Modules, moduleid, action, (!string.IsNullOrEmpty(page.DefaultContainerType)) ? page.DefaultContainerType : site.DefaultContainerType, SiteState.Alias);
|
(page, site.Modules) = ProcessModules(page, site.Modules, moduleid, action, (!string.IsNullOrEmpty(page.DefaultContainerType)) ? page.DefaultContainerType : site.DefaultContainerType, SiteState.Alias);
|
||||||
|
|
||||||
// populate page state (which acts as a client-side cache for subsequent requests)
|
// populate page state (which acts as a client-side cache for subsequent requests)
|
||||||
_pagestate = new PageState
|
_pagestate = new PageState
|
||||||
{
|
{
|
||||||
Alias = SiteState.Alias,
|
Alias = SiteState.Alias,
|
||||||
Site = site,
|
Site = site,
|
||||||
Page = page,
|
Page = page,
|
||||||
User = user,
|
User = user,
|
||||||
Uri = new Uri(_absoluteUri, UriKind.Absolute),
|
Uri = new Uri(_absoluteUri, UriKind.Absolute),
|
||||||
Route = route,
|
Route = route,
|
||||||
QueryString = querystring,
|
QueryString = querystring,
|
||||||
UrlParameters = route.UrlParameters,
|
UrlParameters = route.UrlParameters,
|
||||||
ModuleId = moduleid,
|
ModuleId = moduleid,
|
||||||
Action = action,
|
Action = action,
|
||||||
EditMode = editmode,
|
EditMode = editmode,
|
||||||
LastSyncDate = lastsyncdate,
|
LastSyncDate = lastsyncdate,
|
||||||
Runtime = runtime,
|
Runtime = runtime,
|
||||||
VisitorId = VisitorId,
|
VisitorId = VisitorId,
|
||||||
RemoteIPAddress = SiteState.RemoteIPAddress,
|
RemoteIPAddress = SiteState.RemoteIPAddress,
|
||||||
ReturnUrl = returnurl,
|
ReturnUrl = returnurl,
|
||||||
IsInternalNavigation = _isInternalNavigation
|
IsInternalNavigation = _isInternalNavigation
|
||||||
};
|
};
|
||||||
|
|
||||||
OnStateChange?.Invoke(_pagestate);
|
OnStateChange?.Invoke(_pagestate);
|
||||||
await ScrollToFragment(_pagestate.Uri);
|
await ScrollToFragment(_pagestate.Uri);
|
||||||
// }
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Need to redirect 404 as page doesnot exist in a Permission or Timeframe
|
||||||
|
if (route.PagePath != "404")
|
||||||
|
{
|
||||||
|
// redirect to 404 page
|
||||||
|
NavigationManager.NavigateTo(Utilities.NavigateUrl(SiteState.Alias.Path, "404", ""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // page not found
|
else // page not found
|
||||||
|
|
Loading…
Reference in New Issue
Block a user