コード例 #1
0
 /// <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();
 }
コード例 #2
0
        /// <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();
        }