当前位置: 首页 > news >正文

网络营销是网上销售吗/seo关键词排名优化矩阵系统

网络营销是网上销售吗,seo关键词排名优化矩阵系统,网站建设部门,郑州网站托管公司哪家好一:关于前台权限 1:只允许自己看到 首先,我们需要确定在 Role 设置页面,用户所对应的 View Page by others 和 View all content 未被选中。备注,我们首先和得设置 Anonymous 和 Authenticated 的这两个的权限&#xf…

一:关于前台权限

1:只允许自己看到

首先,我们需要确定在 Role 设置页面,用户所对应的 View Page by others 和 View all content 未被选中。备注,我们首先和得设置 Anonymous 和 Authenticated 的这两个的权限,这两项也未被选中。

这样一来,我们可以达到整个站点,我们只能看到自己的东西,如下:

image

而如果是 Admin 等全权限登录的,应该是这样的:

image

2:只允许某个角色看到

同理1。

 

二:关于自定义权限

首先,我们需要在模块的根目录下创建文件 Permissions:

public class Permissions : IPermissionProvider {
    public static readonly Permission ManageBlogs = new Permission { Description = "Manage blogs for others", Name = "ManageBlogs" };
    public static readonly Permission ManageOwnBlogs = new Permission { Description = "Manage own blogs", Name = "ManageOwnBlogs", ImpliedBy = new[] { ManageBlogs } };

    public static readonly Permission PublishBlogPost = new Permission { Description = "Publish or unpublish blog post for others", Name = "PublishBlogPost", ImpliedBy = new[] { ManageBlogs } };
    public static readonly Permission PublishOwnBlogPost = new Permission { Description = "Publish or unpublish own blog post", Name = "PublishOwnBlogPost", ImpliedBy = new[] { PublishBlogPost, ManageOwnBlogs } };
    public static readonly Permission EditBlogPost = new Permission { Description = "Edit blog posts for others", Name = "EditBlogPost", ImpliedBy = new[] { PublishBlogPost } };
    public static readonly Permission EditOwnBlogPost = new Permission { Description = "Edit own blog posts", Name = "EditOwnBlogPost", ImpliedBy = new[] { EditBlogPost, PublishOwnBlogPost } };
    public static readonly Permission DeleteBlogPost = new Permission { Description = "Delete blog post for others", Name = "DeleteBlogPost", ImpliedBy = new[] { ManageBlogs } };
    public static readonly Permission DeleteOwnBlogPost = new Permission { Description = "Delete own blog post", Name = "DeleteOwnBlogPost", ImpliedBy = new[] { DeleteBlogPost, ManageOwnBlogs } };

    public static readonly Permission MetaListBlogs = new Permission { ImpliedBy = new[] { EditBlogPost, PublishBlogPost, DeleteBlogPost }, Name = "MetaListBlogs"};
    public static readonly Permission MetaListOwnBlogs = new Permission { ImpliedBy = new[] { EditOwnBlogPost, PublishOwnBlogPost, DeleteOwnBlogPost }, Name = "MetaListOwnBlogs" };

    public virtual Feature Feature { get; set; }

    public IEnumerable<Permission> GetPermissions() {
        return new[] {
            ManageOwnBlogs,
            ManageBlogs,
            EditOwnBlogPost,
            EditBlogPost,
            PublishOwnBlogPost,
            PublishBlogPost,
            DeleteOwnBlogPost,
            DeleteBlogPost,
        };
    }

    public IEnumerable<PermissionStereotype> GetDefaultStereotypes() {
        return new[] {
            new PermissionStereotype {
                Name = "Administrator",
                Permissions = new[] {ManageBlogs}
            },
            new PermissionStereotype {
                Name = "Editor",
                Permissions = new[] {PublishBlogPost,EditBlogPost,DeleteBlogPost}
            },
            new PermissionStereotype {
                Name = "Moderator",
            },
            new PermissionStereotype {
                Name = "Author",
                Permissions = new[] {ManageOwnBlogs}
            },
            new PermissionStereotype {
                Name = "Contributor",
                Permissions = new[] {EditOwnBlogPost}
            },
        };
    }

}

其次,我们需要在控制器中,为服务设定权限,如:

public AdminController(IMyService myService, IOrchardServices orchardServices) { _myService = myService; Services = orchardServices; }

。。。

Services.Authorizer.Authorize(Permissions.SomeModulePermission, T("Some operation failed"));

 

三:获取当前登录用户的角色信息

 

四:对 PART 设定权限

 

至此,ORCHARD 已经完全控制了所以的显式和功能权限,包括页面上的 PART部分。

 

参考:

http://docs.orchardproject.net/Documentation/Developer-FAQ

http://orchard.codeplex.com/discussions/547703

http://orchard.codeplex.com/discussions/390754

http://www.jmfq.cn/news/5126131.html

相关文章:

  • 北京网站建设设计公司/百度收录批量提交入口
  • 网站备案 多少钱/站长工具seo优化
  • 网站建建设公司和网络自建/seo优化关键词排名优化
  • 网站需要怎么做的吗/最近国际新闻大事20条
  • 重庆网站建站系统/网络公司优化关键词
  • 网站建设和app开发/免费下载百度seo
  • 介绍旅游美食的网站模板/网站提交入口
  • 湖北网站建设优化/网络营销岗位职责和任职要求
  • 电商实训网站建设报告/seo在哪学
  • 新增专业建设规划/百度词条优化
  • 网站浏览成交指标/电商网店
  • 北京网站设计推荐刻/网站如何赚钱
  • 资讯类网站建设/广州网站设计建设
  • 乐营销网站/seo技术培训泰州
  • 网站布局策划/培训机构网站
  • 0基础做网站/最新国际新闻事件
  • 马云做网站最早/爱站网长尾关键词挖掘工具电脑版
  • 有什么网站建设比较好的公司/百度竞价排名机制
  • 怎么为自己公司做网站/店铺在百度免费定位
  • 欢迎访问中国建设银行网站个人客户/昆明网站开发推广公司
  • 秦皇岛网络优化排名/长尾词seo排名优化
  • 手机主页网站哪个好用/服装品牌营销策划方案
  • 个人响应式网站/网络营销包括哪些
  • 购买网站在线客服系统/东莞做网站推广的公司
  • 上海网站维护/直接下载app
  • wordpress 客户端源码分析/衡阳网站优化公司
  • wordpress 读者墙/百度seo优化软件
  • 忆唐网不做网站做品牌/厦门seo培训学校
  • wordpress多站显示不正常/搜索引擎优化是指什么意思
  • 邢台做网站的那好/宁波百度关键词推广