Ejemplo n.º 1
0
        public void AccessPaths()
        {
            AccessCheck ac = new AccessCheck();

            List <string> ids = new List <string>()
            {
                "fw.de.he.da.mkk.mtl", "fw.de.he.da.mkk.nid"
            };

            List <EmergenyObjectAccessContainer> acl = new List <EmergenyObjectAccessContainer>();

            var oa = new EmergenyObjectAccessContainer("fw.de.he.da.mkk");

            oa.AddAccessRight("stamm", AccessLevelEnum.Read);
            oa.AddAccessRight("status", AccessLevelEnum.Read);
            oa.AddAccessRight("*", AccessLevelEnum.Read);
            acl.Add(oa);

            var res = ac.GetPathsByAccessLevel(AccessLevelEnum.Read, ids, acl);

            Assert.Contains <string>("*", res);
        }
Ejemplo n.º 2
0
        public void AccessPathsLevel()
        {
            AccessCheck ac = new AccessCheck();

            List <string> ids = new List <string>()
            {
                "fw.de.he.da.mkk.mtl", "fw.de.he.da.mkk.nid"
            };
            List <EmergenyObjectAccessContainer> acl = new List <EmergenyObjectAccessContainer>();

            var oa = new EmergenyObjectAccessContainer("fw.de.he.da.mkk");

            oa.AddAccessRight("stamm", AccessLevelEnum.Read);
            acl.Add(oa);
            Assert.Equal <AccessLevelEnum>(AccessLevelEnum.Read, ac.CheckAccessForPath("stamm", ids, acl));
        }