1 structure Domtool
:> DOMTOOL
= struct
5 val proc
= Unix
.execute ("/bin/sh", ["-c", "DOMTOOL_USER=hcoop.daemon /usr/local/bin/domtool-admin perms " ^ user
])
6 val inf
= Unix
.textInstreamOf proc
9 case TextIO.inputLine inf
of
12 case String.tokens (fn ch
=> ch
= #
":") line
of
13 [class
', permissions
] => if class
' = class
then String.tokens
Char.isSpace permissions
else loop ()
17 before ignore (Unix
.reap proc
)
20 fun hasPerm class user value
=
21 List.exists (fn x
=> x
= value
) (perms class user
)