예제 #1
0
 public void FSSweepPremissions(string path, bool subdirectorys, UserGroup toJoin, FilePremission newPremission, Session sess)
 {
     File rootBase;
     if (path == "")
     {
         rootBase = this.RootFile;
     }
     else
     {
         rootBase = this.FSGetDirectory(path, sess);
     }
     this.FSSetPremission(rootBase, toJoin, newPremission, sess);
     this.FSSweepPremissions(rootBase, subdirectorys, toJoin, newPremission, sess);
 }
예제 #2
0
 public void FSSweepPremissions(File path, bool subdirectorys, UserGroup toJoin, FilePremission newPremission, Session sess)
 {
     foreach (File item in path.Children)
     {
         if (item.Directory)
         {
             if (!subdirectorys)
             {
                 continue;
             }
             this.FSSetPremission(item, toJoin, newPremission, sess);
             this.FSSweepPremissions(item, subdirectorys, toJoin, newPremission, sess);
         }
         else
         {
             this.FSSetPremission(item, toJoin, newPremission, sess);
         }
     }
 }
예제 #3
0
 public void FSSetPremission(File item, UserGroup toJoin, FilePremission newPremission, Session sess)
 {
     if (item.CanView(sess.CurrentUser))
     {
         if (item.GroupPremitions.ContainsKey(toJoin))
         {
             item.GroupPremitions[toJoin] = newPremission;
         }
         else
         {
             item.GroupPremitions.Add(toJoin, newPremission);
         }
     }
 }