public UserPermissionDialog(UserPermissionDialogOptions opt)
            : base(opt)
        {
            permissions = new PermissionCheckEditor(this.ById("Permissions"),
                                                    new PermissionCheckEditorOptions {
                ShowRevoke = true
            });

            UserPermissionService.List(new UserPermissionListRequest
            {
                UserID    = options.UserID,
                Module    = null,
                Submodule = null
            }, response =>
            {
                permissions.Value = response.Entities;
            });

            UserPermissionService.ListRolePermissions(new UserPermissionListRequest
            {
                UserID    = options.UserID,
                Module    = null,
                Submodule = null
            }, response =>
            {
                permissions.RolePermissions = response.Entities;
            });
        }
Example #2
0
        public RolePermissionDialog(RolePermissionDialogOptions opt)
            : base(opt)
        {
            permissions = new PermissionCheckEditor(this.ById("Permissions"),
                                                    new PermissionCheckEditorOptions {
                ShowRevoke = false
            });

            RolePermissionService.List(new RolePermissionListRequest
            {
                RoleID    = options.RoleID,
                Module    = null,
                Submodule = null
            }, response =>
            {
                permissions.Value = response.Entities.Select(x => new UserPermissionRow {
                    PermissionKey = x
                }).ToList();
            });
        }