public override void Define(IPermissionDefinitionContext context)
        {
            var salesGroup = context.AddGroup(SalesPermissions.GroupName, L("Permission:Sales"));

            // Accounts
            PermissionDefinition accountsPermission = salesGroup.AddPermission(SalesPermissions.Accounts, L("Permission:Accounts"), MultiTenancySides.Both);

            accountsPermission.AddChild(SalesPermissions.CreateAccounts, L("Permission:Accounts:Create"), MultiTenancySides.Both);
            accountsPermission.AddChild(SalesPermissions.EditAccounts, L("Permission:Accounts:Edit"), MultiTenancySides.Both);
            accountsPermission.AddChild(SalesPermissions.DeleteAccounts, L("Permission:Accounts:Delete"), MultiTenancySides.Both);
        }
예제 #2
0
 private static void DefineGroupCrud(PermissionDefinition parentPermission, IEnumerable <string> crudNames)
 {
     foreach (var crudName in crudNames)
     {
         parentPermission.AddChild(crudName, L($"Permission:{crudName}"), MultiTenancySides.Tenant);
     }
 }
예제 #3
0
        public override void Define(IPermissionDefinitionContext context)
        {
            PermissionGroupDefinition snookerGroup = context.AddGroup(SnookerPermissions.GroupName);

            //Define your own permissions here. Example:
            //myGroup.AddPermission(SnookerPermissions.MyPermission1, L("Permission:MyPermission1"));

            PermissionDefinition clubPermission = snookerGroup.AddPermission(SnookerPermissions.Clubs.Default, L("Permission:Clubs"));

            clubPermission.AddChild(SnookerPermissions.Clubs.Create, L("Permission:Create"));
            clubPermission.AddChild(SnookerPermissions.Clubs.Edit, L("Permission:Edit"));
            clubPermission.AddChild(SnookerPermissions.Clubs.Delete, L("Permission:Delete"));

            PermissionDefinition playerPermission = snookerGroup.AddPermission(SnookerPermissions.Players.Default, L("Permission:Players"));

            playerPermission.AddChild(SnookerPermissions.Players.Create, L("Permission:Create"));
            playerPermission.AddChild(SnookerPermissions.Players.Edit, L("Permission:Edit"));
            playerPermission.AddChild(SnookerPermissions.Players.Delete, L("Permission:Delete"));
        }
        public override void Define(IPermissionDefinitionContext context)
        {
            PermissionGroupDefinition moduleGroup = context.AddGroup(HelloPermissions.GroupName, L("Hello"));

            PermissionDefinition city = moduleGroup.AddPermission(HelloPermissions.City.Default, L("Hello:City"));

            city.AddChild(HelloPermissions.City.View, L("Hello:City:View"));
            city.AddChild(HelloPermissions.City.Create, L("Hello:City:Create"));
            city.AddChild(HelloPermissions.City.Update, L("Hello:City:Update"));
            city.AddChild(HelloPermissions.City.Delete, L("Hello:City:Delete"));
            city.AddChild(HelloPermissions.City.Search, L("Hello:City:Search"));

            PermissionDefinition country = moduleGroup.AddPermission(HelloPermissions.Country.Default, L("Hello:Country"));

            country.AddChild(HelloPermissions.Country.View, L("Hello:Country:View"));
            country.AddChild(HelloPermissions.Country.Create, L("Hello:Country:Create"));
            country.AddChild(HelloPermissions.Country.Update, L("Hello:Country:Update"));
            country.AddChild(HelloPermissions.Country.Delete, L("Hello:Country:Delete"));
            country.AddChild(HelloPermissions.Country.Search, L("Hello:Country:Search"));
        }
예제 #5
0
        public IEnumerable <PermissionDefinition> Definitions()
        {
            var authorization = new PermissionDefinition(Pages.Authorization, "授权管理");

            var roles = authorization.AddChild(Pages.Authorization_Role, "角色管理", "拥有管理角色的权限。");

            roles.AddChild(Pages.Authorization_Role_CreateOrEditOrDelete, "创建、编辑、删除角色");
            roles.AddChild(Pages.Authorization_Role_AssignPermission, "分配权限");

            var users = authorization.AddChild(Pages.Authorization_User, "用户管理", "拥有管理用户的权限。");

            users.AddChild(Pages.Authorization_User_CreateOrEditOrDelete, "创建、编辑、删除用户");
            users.AddChild(Pages.Authorization_User_AssignRole, "分配角色");

            var configuration = new PermissionDefinition(Pages.Configuration, "系统配置", "拥有系统配置的管理权限。");

            configuration.AddChild(Pages.Configuration_SiteSetting, "站点配置");
            configuration.AddChild(Pages.Configuration_UserSetting, "账户配置");
            configuration.AddChild(Pages.Configuration_EmailSetting, "邮件配置");
            configuration.AddChild(Pages.Configuration_ResumeSetting, "简历配置");

            var dictionary = configuration.AddChild(Pages.Configuration_Dictionary, "数据字典");

            dictionary.AddChild(Pages.Configuration_Dictionary_CreateOrEditOrDelete, "创建、编辑、删除数据字典");

            var job = new PermissionDefinition(Pages.Job, "职位", "拥有职位的管理权限。");

            job.AddChild(Pages.Job_CreateOrEditOrDelete, "创建、编辑、删除职位");

            var resume = new PermissionDefinition(Pages.Resume, "简历管理", "拥有简历库的管理权限。");

            resume.AddChild(Pages.Resume_CreateOrEditOrDelete, "创建、编辑、删除简历");
            resume.AddChild(Pages.Resume_AssignUser, "分配负责人");
            resume.AddChild(Pages.Resume_SendEmail, "发送邮件");
            resume.AddChild(Pages.Resume_AuditSetting, "审核配置");

            var investigation = new PermissionDefinition(Pages.Investigation, "意向调查", "拥有意向调查的管理权限。");

            investigation.AddChild(Pages.Investigation_CreateOrEditOrDelete, "创建、编辑、删除意向调查");
            investigation.AddChild(Pages.Investigation_FinshOrRestore, "结束调查/恢复调查");
            investigation.AddChild(Pages.Investigation_Audit, "审核调查");

            var interview = new PermissionDefinition(Pages.Interview, "面试预约", "拥有面试预约的管理权限。");

            interview.AddChild(Pages.Interview_CreateOrEditOrDelete, "创建、编辑、删除面试预约");

            var evaluation = new PermissionDefinition(Pages.Evaluation, "技术评测", "拥有技术评测的权限。");

            evaluation.AddChild(Pages.Evaluation_CreateOrEditOrDelete, "创建、编辑、删除技术评测");

            var dailyStatistic = new PermissionDefinition(Pages.DailyStatistic, "每日数据统计", "拥有每日数据统计的权限。");

            dailyStatistic.AddChild(Pages.DailyStatistic_CreateOrEditOrDelete, "创建、编辑、删除每日数据统计");

            return(new[] {
                authorization,
                configuration,
                job,
                resume,
                investigation,
                interview,
                evaluation,
                dailyStatistic
            });
        }