Example #1
0
 public void testWrite(subcap sb, objc ob)
 {
     if ((new accesstate(sb, ob, mat.retperm(sb, ob)).canWrite(mat)) == false)
         Console.WriteLine("NO, SUBJECT {0} CANNOT PERFORM WRITE ON {1}", sb.retn(), ob.retn());
     else
         Console.WriteLine("YES, SUBJECT {0} CAN PERFORM WRITE ON {1}", sb.retn(), ob.retn());
 }
Example #2
0
        public slevel(subcap s, char c)
        {
            if (c == 'C')
                clas = s.retclasc();
            if (c == 'M' || c == 'S')
                clas = s.retclasm();

            comp = s.retcomp();
        }
Example #3
0
 public void addperm(subcap sb, objc ob, char c)
 {
     if (c == 'W')
         addperm(sb, ob, subcap.acces.write);
     if (c == 'A')
         addperm(sb, ob, subcap.acces.append);
     if (c == 'R')
         addperm(sb, ob, subcap.acces.read);
     if (c == 'E')
         addperm(sb, ob, subcap.acces.exec);
 }
Example #4
0
 public void testExec(subcap sb, objc ob)
 {
     if ((new accesstate(sb, ob, mat.retperm(sb, ob)).canExec(mat)) == false)
     {
         Console.WriteLine("NO, SUBJECT {0} CANNOT PERFORM EXECUTE ON {1}", sb.retn(), ob.retn());
     }
     else
     {
         Console.WriteLine("YES, SUBJECT {0} CAN PERFORM EXECUTE ON {1}", sb.retn(), ob.retn());
     }
 }
Example #5
0
        public slevel(subcap s, char c)
        {
            if (c == 'C')
            {
                clas = s.retclasc();
            }
            if (c == 'M' || c == 'S')
            {
                clas = s.retclasm();
            }

            comp = s.retcomp();
        }
Example #6
0
 public accesstate(subcap s, objc o, List <subcap.acces> a)
 {
     sb = s;
     ob = o;
     ac = a;
 }
Example #7
0
 public accesstate(subcap s, objc o, List<subcap.acces> a)
 {
     sb = s;
     ob = o;
     ac = a;
 }
Example #8
0
 public void addsbj(subcap s)
 {
     sbj.Add(s);
     sbj[sbj.Count - 1].initobj(obj.Count);
 }
Example #9
0
 public void addperm(subcap sb, objc ob, subcap.acces dr)
 {
     sbj.Find(it => it == sb).addcapI(obj.IndexOf(ob), dr);
 }
Example #10
0
 public void addperm(string sb, string ob, subcap.acces dr)
 {
     sbj[sbjindex(sb)].addcapI(objindex(ob), dr);
 }
Example #11
0
 public void setperm(subcap sb, objc ob, subcap.acces dr)
 {
     List<subcap.acces> ac = new List<subcap.acces>();
     ac.Add(dr);
     sbj.Find(it => it == sb).setcapI(obj.IndexOf(ob), ac);
 }
Example #12
0
 public void setperm(subcap sb, objc ob, List<subcap.acces> ac)
 {
     sbj.Find(it => it == sb).setcapI(obj.IndexOf(ob), ac);
 }
Example #13
0
 public void setperm(string sb, string ob, subcap.acces dr)
 {
     List<subcap.acces> ac = new List<subcap.acces>();
     ac.Add(dr);
     sbj[sbjindex(sb)].setcapI(objindex(ob), ac);
 }
Example #14
0
 public List<subcap.acces> retperm(subcap sb, objc ob)
 {
     return sbj.Find(it => it == sb).retcapI(obj.IndexOf(ob));
 }
Example #15
0
 public void remsbj(subcap s)
 {
     sbj.Remove(s);
 }