Commit 31292386 authored by Marc Duez's avatar Marc Duez

server: default access for admin

parent 99827ead
......@@ -160,18 +160,23 @@ if db(db.auth_user.id > 0).count() == 0:
## création des groupes de base
id_admin_group=db.auth_group.insert(role='admin')
id_sa_group=db.auth_group.insert(role='user_1')
db.auth_group.insert(role='group_1')
db.auth_group.insert(role='group_2')
db.auth_group.insert(role='group_3')
db.auth_group.insert(role="public")
db.auth_group.insert(role="visitor")
db.auth_membership.insert(user_id=id_first_user, group_id=id_admin_group)
db.auth_membership.insert(user_id=id_first_user, group_id=id_sa_group)
## permission
## system admin have admin rights on all patients and groups
## system admin have admin/read/create rights on all patients, groups and configs
auth.add_permission(id_admin_group, 'admin', db.patient, 0)
auth.add_permission(id_admin_group, 'admin', db.auth_group, 0)
auth.add_permission(id_admin_group, 'admin', db.config, 0)
auth.add_permission(id_admin_group, 'read', db.patient, 0)
auth.add_permission(id_admin_group, 'read', db.auth_group, 0)
auth.add_permission(id_admin_group, 'read', db.config, 0)
auth.add_permission(id_admin_group, 'create', db.patient, 0)
auth.add_permission(id_admin_group, 'create', db.auth_group, 0)
auth.add_permission(id_admin_group, 'create', db.config, 0)
## after defining tables, uncomment below to enable auditing
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment