Example #1
0
        private void SetPermissionSetSettings(GroupViewModel model, AssignRoleModel permissionSetRole)
        {
            model.PermissionSetStartDate        = permissionSetRole.StartDate;
            model.PermissionSetEndDate          = permissionSetRole.EndDate;
            model.PermissionSetMaxNumberOfUsers = permissionSetRole.MaxNumberOfUsers;

            var groupPermissions = this._roleManager.Query().Where(r => r.Id == permissionSetRole.Id).SelectMany(r => r.Permissions);

            foreach (var permission in groupPermissions)
            {
                var modelPermission = model.Permissions.FirstOrDefault(p => p.Id == permission.Id);

                if (modelPermission != null)
                {
                    modelPermission.Selected = true;
                }
            }
        }
        private void SetPermissionSetSettings(GroupViewModel model, AssignRoleModel permissionSetRole)
        {
            model.PermissionSetStartDate = permissionSetRole.StartDate;
            model.PermissionSetEndDate = permissionSetRole.EndDate;
            model.PermissionSetMaxNumberOfUsers = permissionSetRole.MaxNumberOfUsers;

            var groupPermissions = this._roleManager.Query().Where(r => r.Id == permissionSetRole.Id).SelectMany(r => r.Permissions);

            foreach (var permission in groupPermissions)
            {
                var modelPermission = model.Permissions.FirstOrDefault(p => p.Id == permission.Id);

                if (modelPermission != null)
                {
                    modelPermission.Selected = true;
                }
            }
        }