2021-11-29 08:37:52 +01:00
|
|
|
from halfapi.lib import acl
|
|
|
|
from halfapi.lib.acl import public
|
2021-11-29 06:09:18 +01:00
|
|
|
from random import randint
|
|
|
|
|
2021-11-29 08:37:52 +01:00
|
|
|
def random():
|
2021-11-30 18:31:40 +01:00
|
|
|
""" Random access ACL
|
|
|
|
"""
|
2021-11-29 08:37:52 +01:00
|
|
|
return randint(0,1) == 1
|
2021-11-29 06:09:18 +01:00
|
|
|
|
2021-11-29 08:37:52 +01:00
|
|
|
def denied():
|
2021-11-30 18:31:40 +01:00
|
|
|
""" Access denied
|
|
|
|
"""
|
2021-11-29 08:37:52 +01:00
|
|
|
return False
|
2021-11-29 06:09:18 +01:00
|
|
|
|
2021-11-30 18:31:40 +01:00
|
|
|
ACLS = (
|
|
|
|
('public', public.__doc__, 999),
|
|
|
|
('random', random.__doc__, 10),
|
|
|
|
('denied', denied.__doc__, 0)
|
|
|
|
)
|
|
|
|
|
|
|
|
|