create user permissions on save of employee
This commit is contained in:
parent
e647c1f3cb
commit
2f89a04511
@ -68,10 +68,8 @@ class Employee(NestedSet):
|
||||
if not self.create_user_permission: return
|
||||
if not has_permission('User Permission', ptype='write'): return
|
||||
|
||||
if not has_user_permission_for_employee(self.user_id, self.name):
|
||||
add_user_permission("Employee", self.name, self.user_id)
|
||||
if not has_user_permission_for_employee(self.user_id, self.company):
|
||||
set_user_permission_if_allowed("Company", self.company, self.user_id)
|
||||
add_user_permission("Employee", self.name, self.user_id)
|
||||
set_user_permission_if_allowed("Company", self.company, self.user_id)
|
||||
|
||||
def update_user(self):
|
||||
# add employee role if missing
|
||||
|
Loading…
x
Reference in New Issue
Block a user