gameServer/HandlerUtils.hs
changeset 10194 7025bd3c3131
parent 9433 f0a8ac191839
child 10212 5fb3bb2de9d2
--- a/gameServer/HandlerUtils.hs	Wed Mar 12 22:40:49 2014 -0400
+++ b/gameServer/HandlerUtils.hs	Thu Mar 13 23:25:31 2014 +0400
@@ -66,3 +66,10 @@
     let allClientIDs = allClients rnc
     return $ find (\clId -> let cl = client rnc clId in n == nick cl && not (isChecker cl)) allClientIDs
 
+
+roomAdminOnly :: Reader (ClientIndex, IRnC) [Action] -> Reader (ClientIndex, IRnC) [Action]
+roomAdminOnly h = thisClient >>= \cl -> if isMaster cl then h else return []
+
+
+serverAdminOnly :: Reader (ClientIndex, IRnC) [Action] -> Reader (ClientIndex, IRnC) [Action]
+serverAdminOnly h = thisClient >>= \cl -> if isAdministrator cl then h else return []