public override void Save(NodeSaveSettings settings) { if (this.IsNew) { SecurityHandler.Assert(this.ParentId, PermissionType.ManageListsAndWorkspaces); } else { this.Security.Assert(PermissionType.ManageListsAndWorkspaces); } AssertEmail(); var newEmail = this["ListEmail"] as string; var listEmailChanged = IsNew && !string.IsNullOrEmpty(newEmail) || !IsNew && IsPropertyChanged("ListEmail"); if (listEmailChanged) { SetAllowedChildTypesForEmails(); } base.Save(settings); if (listEmailChanged) { MailProvider.Instance.OnListEmailChanged(this); } }
// ===================================================================================== Overrides /// <inheritdoc /> public override void Save(NodeSaveSettings settings) { if (this.IsNew) { SecurityHandler.Assert(this.ParentId, PermissionType.ManageListsAndWorkspaces); } else { this.Security.Assert(PermissionType.ManageListsAndWorkspaces); } base.Save(settings); }
public override void Save(NodeSaveSettings settings) { if (this.IsNew) { SecurityHandler.Assert(this.ParentId, PermissionType.ManageListsAndWorkspaces); } else { this.Security.Assert(PermissionType.ManageListsAndWorkspaces); } AssertEmail(); var newEmail = this["ListEmail"] as string; var listEmailChanged = (IsNew && !string.IsNullOrEmpty(newEmail)) || (!IsNew && IsPropertyChanged("ListEmail")); if (listEmailChanged) { SetAllowedChildTypesForEmails(); } base.Save(settings); if (listEmailChanged) { using (new SystemAccount()) { // remove current mail processor workflow RemoveWorkflow(); // start new workflow + subscription if email is given if (!string.IsNullOrEmpty(newEmail)) { StartSubscription(); } } } }
/*========================================================== Evaluation related methods */ /// <summary> /// If one or more passed permissions are not allowed (undefined or denied) on the current content for the current user, SenseNetSecurityException will be thrown. /// </summary> /// <param name="permissionTypes">Set of related permissions. Cannot be null. Empty set means "allowed nothing" so SenseNetSecurityException will be thrown.</param> public void Assert(params PermissionType[] permissionTypes) { _securityHandler.Assert(_node, permissionTypes); }