Fix #138
This commit is contained in:
13
cps/ub.py
13
cps/ub.py
@ -24,6 +24,7 @@ ROLE_UPLOAD = 4
|
||||
ROLE_EDIT = 8
|
||||
ROLE_PASSWD = 16
|
||||
ROLE_ANONYMOUS = 32
|
||||
ROLE_EDIT_SHELFS = 64
|
||||
|
||||
DETAIL_RANDOM = 1
|
||||
SIDEBAR_LANGUAGE = 2
|
||||
@ -86,6 +87,12 @@ class UserBase:
|
||||
else:
|
||||
return False
|
||||
|
||||
def role_edit_shelfs(self):
|
||||
if self.role is not None:
|
||||
return True if self.role & ROLE_EDIT_SHELFS == ROLE_EDIT_SHELFS else False
|
||||
else:
|
||||
return False
|
||||
|
||||
def is_active(self):
|
||||
return True
|
||||
|
||||
@ -353,6 +360,12 @@ class Config:
|
||||
else:
|
||||
return False
|
||||
|
||||
def role_edit_shelfs(self):
|
||||
if self.config_default_role is not None:
|
||||
return True if self.config_default_role & ROLE_EDIT_SHELFS == ROLE_EDIT_SHELFS else False
|
||||
else:
|
||||
return False
|
||||
|
||||
def get_Log_Level(self):
|
||||
ret_value=""
|
||||
if self.config_log_level == logging.INFO:
|
||||
|
Reference in New Issue
Block a user