-
Notifications
You must be signed in to change notification settings - Fork 28
AccessControlList
sunng87 edited this page Mar 9, 2012
·
4 revisions
ACL module can be enabled via assigning IP-based rules during Slacker server startup.
defrules
provides a DSL to define access rules.
Code examples:
(use 'slacker.acl)
;; All IP are denied by default !
;; If an IP is denied explicitly, whatever it's in an allowed IP segment or not, it will be denied.
;; allow IP within 192.168.1.* and 192.168.100.* to access
(defrules myrules
(allow ["192.168.1.*" "192.168.100.*"]))
;;Any IP within 192.168.1.* and 192.168.100.* is allowed except 192.168.1.10
(defrules myrules
(deny ["192.168.1.10"])
(allow ["192.168.1.*" "192.168.100.*"]))
;All IP is allowed
(defrules myrules
(allow :all))
ACL module can be enabled during Slacker server startup.
(start-slacker-server (the-ns 'slacker.example.api) 2104
:acl myrules)