/// <summary> /// saves the current policy (usually after changed with Casbin API) /// back to file/database. /// </summary> public void SavePolicy() { if (IsFiltered()) { throw new Exception("cannot save a filtered policy"); } adapter.SavePolicy(model); watcher?.Update(); }
/// <summary> /// Saves the current policy (usually after changed with Casbin API) /// back to file/database. /// </summary> public void SavePolicy() { if (adapter is null) { return; } if (IsFiltered()) { throw new InvalidOperationException("Cannot save a filtered policy"); } adapter.SavePolicy(model); watcher?.Update(); }