@@ -8,13 +8,13 @@ class DocType: | |||||
def __init__(self, d, dl): | def __init__(self, d, dl): | ||||
self.doc, self.doclist = d, dl | self.doc, self.doclist = d, dl | ||||
# todo is viewable if either user or assigned_to or System Manager in roles | |||||
# todo is viewable if either owner or assigned_to or System Manager in roles | |||||
def get_permission_query_conditions(): | def get_permission_query_conditions(): | ||||
if "System Manager" in webnotes.get_roles(): | if "System Manager" in webnotes.get_roles(): | ||||
return None | return None | ||||
else: | else: | ||||
return """(tabToDo.owner = '{user}' or tabToDo.assigned_to = '{user}' or )""".format(user=webnotes.session.user) | |||||
return """(tabToDo.owner = '{user}' or tabToDo.assigned_to = '{user}')""".format(user=webnotes.session.user) | |||||
def has_permission(doc): | def has_permission(doc): | ||||
if "System Manager" in webnotes.get_roles(): | if "System Manager" in webnotes.get_roles(): | ||||
@@ -26,4 +26,7 @@ on_session_creation = webnotes.auth.notify_administrator_login | |||||
# permissions | # permissions | ||||
permission_query_conditions:Event = webnotes.core.doctype.event.event.get_permission_query_conditions | permission_query_conditions:Event = webnotes.core.doctype.event.event.get_permission_query_conditions | ||||
has_permission:Event = webnotes.core.doctype.event.event.has_permission | |||||
has_permission:Event = webnotes.core.doctype.event.event.has_permission | |||||
permission_query_conditions:ToDo = webnotes.core.doctype.todo.todo.get_permission_query_conditions | |||||
has_permission:ToDo = webnotes.core.doctype.todo.todo.has_permission |
@@ -87,7 +87,7 @@ def install_app(name, verbose=False): | |||||
webnotes.flags.in_install_app = name | webnotes.flags.in_install_app = name | ||||
webnotes.clear_cache() | webnotes.clear_cache() | ||||
app_hooks = webnotes.get_hooks(name) | |||||
app_hooks = webnotes.get_hooks(app_name=name) | |||||
installed_apps = webnotes.get_installed_apps() | installed_apps = webnotes.get_installed_apps() | ||||
if name in installed_apps: | if name in installed_apps: | ||||