change IsEffectiiveOrExpired to IsEffectiveAndNotExpired
This commit is contained in:
@ -80,7 +80,7 @@ namespace Oqtane.Infrastructure
|
||||
if (page.ModifiedOn >= lastIndexedOn && !ignoreEntities.Contains(EntityNames.Page))
|
||||
{
|
||||
changed = true;
|
||||
removed = page.IsDeleted || !Utilities.IsEffectiveOrExpired(page.EffectiveDate, page.ExpiryDate);
|
||||
removed = page.IsDeleted || !Utilities.IsEffectiveAndNotExpired(page.EffectiveDate, page.ExpiryDate);
|
||||
|
||||
var searchContent = new SearchContent
|
||||
{
|
||||
@ -229,7 +229,7 @@ namespace Oqtane.Infrastructure
|
||||
searchContent.AdditionalContent = string.Empty;
|
||||
}
|
||||
|
||||
if (removed || pageModule.IsDeleted || !Utilities.IsEffectiveOrExpired(pageModule.EffectiveDate, pageModule.ExpiryDate))
|
||||
if (removed || pageModule.IsDeleted || !Utilities.IsEffectiveAndNotExpired(pageModule.EffectiveDate, pageModule.ExpiryDate))
|
||||
{
|
||||
searchContent.IsDeleted = true;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ namespace Oqtane.Managers
|
||||
List<UserRole> userroles = _userRoles.GetUserRoles(userId, siteId).ToList();
|
||||
foreach (UserRole userrole in userroles)
|
||||
{
|
||||
if (Utilities.IsEffectiveOrExpired(userrole.EffectiveDate, userrole.ExpiryDate))
|
||||
if (Utilities.IsEffectiveAndNotExpired(userrole.EffectiveDate, userrole.ExpiryDate))
|
||||
{
|
||||
roles += userrole.Role.Name + ";";
|
||||
if (userrole.Role.Name == RoleNames.Host && !userroles.Any(item => item.Role.Name == RoleNames.Admin))
|
||||
|
@ -83,7 +83,7 @@ namespace Oqtane.Security
|
||||
var role = userRoles.FirstOrDefault(item => item.Role.Name == roleName);
|
||||
if (role != null)
|
||||
{
|
||||
if (Utilities.IsEffectiveOrExpired(role.EffectiveDate,role.ExpiryDate))
|
||||
if (Utilities.IsEffectiveAndNotExpired(role.EffectiveDate,role.ExpiryDate))
|
||||
{
|
||||
user.Roles += roleName + ";";
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ namespace Oqtane.Services
|
||||
var pages = new List<Page>();
|
||||
foreach (Page page in site.Pages)
|
||||
{
|
||||
if (!page.IsDeleted && _userPermissions.IsAuthorized(_accessor.HttpContext.User, PermissionNames.View, page.PermissionList) && (Utilities.IsEffectiveOrExpired(page.EffectiveDate, page.ExpiryDate) || _userPermissions.IsAuthorized(_accessor.HttpContext.User, PermissionNames.Edit, page.PermissionList)))
|
||||
if (!page.IsDeleted && _userPermissions.IsAuthorized(_accessor.HttpContext.User, PermissionNames.View, page.PermissionList) && (Utilities.IsEffectiveAndNotExpired(page.EffectiveDate, page.ExpiryDate) || _userPermissions.IsAuthorized(_accessor.HttpContext.User, PermissionNames.Edit, page.PermissionList)))
|
||||
{
|
||||
pages.Add(page);
|
||||
}
|
||||
@ -256,7 +256,7 @@ namespace Oqtane.Services
|
||||
var modules = new List<Module>();
|
||||
foreach (Module module in sitemodules.Where(item => (item.PageId == pageId || pageId == -1) && !item.IsDeleted && _userPermissions.IsAuthorized(_accessor.HttpContext.User, PermissionNames.View, item.PermissionList)))
|
||||
{
|
||||
if (Utilities.IsEffectiveOrExpired(module.EffectiveDate, module.ExpiryDate) || _userPermissions.IsAuthorized(_accessor.HttpContext.User, PermissionNames.Edit, module.PermissionList))
|
||||
if (Utilities.IsEffectiveAndNotExpired(module.EffectiveDate, module.ExpiryDate) || _userPermissions.IsAuthorized(_accessor.HttpContext.User, PermissionNames.Edit, module.PermissionList))
|
||||
{
|
||||
modules.Add(module);
|
||||
}
|
||||
|
Reference in New Issue
Block a user