public void UpdateContentPagePermission(string name, ContentPagePermissionCollection contentPagePeimissionCollection) { var page = PageRepository.GetPageOfAllIncludes(name); if (page == null) { throw new UserFriendlyException("未找到页面"); } if (!(page is ContentPage)) { throw new UserFriendlyException("无法更改页面权限,请确保页面属于内容页"); } var contentPage = (ContentPage)page; contentPage.ContentPagePermissionCollection = contentPagePeimissionCollection; SetPageInvalidForCache(page.Name); }
/// <summary> /// 更新内容也权限 /// </summary> /// <param name="pageName"></param> /// <param name="contentPagePeimissionCollection"></param> public void UpdateContentPagePermission(string pageName, ContentPagePermissionCollection contentPagePeimissionCollection) { contentPagePeimissionCollection.PageName = pageName; _contentPagePermissionCollectionRepository.Delete(e => e.PageName == pageName); _contentPagePermissionCollectionRepository.Insert(contentPagePeimissionCollection); }
public ContentPage(string name) : base(name) { ContentPagePermissionCollection = new ContentPagePermissionCollection(); }