コード例 #1
0
        private List <ContentPermission> AddAdminPermissions(PageContent pageContent)
        {
            //Update admin permissions
            var adminPermissions = new List <ContentPermission>();

            adminPermissions.Add(new ContentPermission
            {
                PageContentId = pageContent.Id,
                RoleId        = Globals.AdministratorRoleId,
                PermissionId  = Globals.ContentViewPermissionId,
            });

            adminPermissions.Add(new ContentPermission
            {
                PageContentId = pageContent.Id,
                RoleId        = Globals.AdministratorRoleId,
                PermissionId  = Globals.ContentEditPermissionId,
            });
            adminPermissions = _pageContentRepository.AddContentPermissions(adminPermissions);
            return(adminPermissions);
        }