{
Compare guard levels.
-1 if g1 less then  g2
 0 if g1 equavalent g2
+1 if g1 more then  g2
}
function CompareGuards(g1,g2:String):Integer;
const g_List='LOCK,GUEST,USER,ROOT';
var p,p1,p2:Integer;
begin
 p1:=pos(UpCaseStr(Trim(g1)),g_List);
 p2:=pos(UpCaseStr(Trim(g2)),g_List);
 if (p1=0) or (p2=0) then p:=-1 else p:=sign(p2-p1);
 CompareGuards:=p;
end;
