Example #1
0
        public List <string> GetAccessPaths(AccessLevelEnum requiredAccessLevel, EmergencyObject obj, EndpointIdentity id)
        {
            List <string> res;
            bool          isOwner = (obj.header.createdBy == id.uid);

            if (isOwner)
            {
                res = new List <string>()
                {
                    "*"
                };
                return(res);
            }

            res = access.GetPathsByAccessLevel(requiredAccessLevel, id.accessIdentity, obj.header.Access);

            return(res);
        }
Example #2
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);
        }
Example #3
0
 private List <string> GetAccessablePaths(AccessLevelEnum acl, EmergencyObject obj, EndpointIdentity id)
 {
     return(access.GetPathsByAccessLevel(acl, id.accessIdentity, obj.header.Access));
 }