Roles and Permissions Support
In version 6.0, we support 10 permissions, more permissions will be added later.
In version 6.1, we added a new permission which can be used to set quota for a certain role of users. For example, we can set the quota of employee to 100G by adding 'role_quota': '100g'
, and leave other role of users to the default quota.
Seafile comes with two build-in roles default
and guest
, a default user is a normal user with permissions as followings:
'guest': {
'can_add_repo': False,
'can_add_group': False,
'can_view_org': False,
'can_use_global_address_book': False,
'can_generate_share_link': False,
'can_generate_upload_link': False,
'can_invite_guest': False,
'can_connect_with_android_clients': False,
'can_connect_with_ios_clients': False,
'can_connect_with_desktop_clients': False,
'role_quota': '',
},
If you want to edit the permissions of build-in roles, e.g. default users can invite guest, guest users can view repos in organization, you can add following lines to seahub_settings.py
with corresponding permissions set to True
.
An user who has can_invite_guest
permission can invite people outside of the organization as guest.
In order to use this feature, in addition to granting can_invite_guest
permission to the user, add the following line to seahub_settings.py
,
Users can invite a guest user by providing his/her email address, system will email the invite link to the user.
Tip: If you want to block certain email addresses for the invitation, you can define a blacklist, e.g.
After that, email address “a@a.com”, any email address ends with “-a-a.com” and any email address ends with “@foo.com” or “.com” will not be allowed.
Add custom roles
ENABLED_ROLE_PERMISSIONS = {
'can_add_repo': True,
'can_add_group': True,
'can_view_org': True,
'can_use_global_address_book': True,
'can_generate_share_link': True,
'can_generate_upload_link': True,
'can_invite_guest': False,
'can_connect_with_android_clients': True,
'can_connect_with_ios_clients': True,
'can_connect_with_desktop_clients': True,
'role_quota': '',
},
'guest': {
'can_add_repo': False,
'can_add_group': False,
'can_view_org': False,
'can_generate_share_link': False,
'can_invite_guest': False,
'can_connect_with_android_clients': False,
'can_connect_with_ios_clients': False,
'can_connect_with_desktop_clients': False,
'role_quota': '',
},
'employee': {
'can_add_repo': True,
'can_add_group': True,
'can_view_org': True,
'can_use_global_address_book': True,
'can_generate_share_link': True,
'can_generate_upload_link': True,
'can_invite_guest': True,
'can_connect_with_android_clients': True,
'can_connect_with_ios_clients': True,
'can_connect_with_desktop_clients': True,
'role_quota': '',