Fix owner_* rights with python2 (fix #49)
This commit is contained in:
parent
f7f26afd6b
commit
07a9ce8296
@ -24,6 +24,7 @@ Rights management.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import io
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
from . import config, log
|
from . import config, log
|
||||||
@ -50,7 +51,7 @@ def _read_from_sections(user, collection, permission):
|
|||||||
regex = ConfigParser({"login": user, "path": collection})
|
regex = ConfigParser({"login": user, "path": collection})
|
||||||
if TYPE in DEFINED_RIGHTS:
|
if TYPE in DEFINED_RIGHTS:
|
||||||
log.LOGGER.debug("Rights type '%s'" % TYPE)
|
log.LOGGER.debug("Rights type '%s'" % TYPE)
|
||||||
regex.read_string(DEFINED_RIGHTS[TYPE])
|
regex.readfp(io.BytesIO(DEFINED_RIGHTS[TYPE]))
|
||||||
elif TYPE == "from_file":
|
elif TYPE == "from_file":
|
||||||
log.LOGGER.debug("Reading rights from file %s" % FILENAME)
|
log.LOGGER.debug("Reading rights from file %s" % FILENAME)
|
||||||
if not regex.read(FILENAME):
|
if not regex.read(FILENAME):
|
||||||
|
Loading…
Reference in New Issue
Block a user