-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group link invitation #6055
Group link invitation #6055
Conversation
@@ -344,6 +344,9 @@ | |||
re_path(r'^api/v2.1/groups/(?P<group_id>\d+)/members/(?P<email>[^/]+)/$', GroupMember.as_view(), name='api-v2.1-group-member'), | |||
re_path(r'^api/v2.1/search-group/$', SearchGroup.as_view(), name='api-v2.1-search-group'), | |||
|
|||
re_path(r'^api/v2.1/groups/(?P<group_id>\d+)/invite-links/$', GroupInviteLinks.as_view(),name='api-v2.1-group-invite-links'), | |||
re_path(r'^api/v2.1/groups/(?P<group_id>\d+)/invite-links/(?P<token>[-0-9a-f]{8})/$', GroupInviteLink.as_view(), name='api-v2.1-group-invite-link'), | |||
re_path(r'^group-invite/(?P<token>[-0-9a-f]{8})/$', group_invite, name='group_invite'), | |||
## address book |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
group-invite 这个不要写在 api/v2.1/...的区域, 同时 group_invite view也不要写在 api 的endpoints里面, 放在group/view.py 文件里面
group = ccnet_api.get_group(group_id) | ||
if MULTI_TENANCY: | ||
error_msg = ' Multiple tenancy is not supported.' | ||
return api_error(status.HTTP_400_BAD_REQUEST, error_msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error_msg = ' Feature disabled.' 上面都是如此。
同时需要判断该group是群组还是部门
return api_error(status.HTTP_404_NOT_FOUND, error_msg) | ||
|
||
if not is_group_owner_or_admin(group, email): | ||
error_msg = 'Permission denied.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经有一个函数叫is_group_admin_or_owner可以使用, 不用重新定义该函数了
seahub/profile/models.py
Outdated
|
||
cache.set(key, nickname, NICKNAME_CACHE_TIMEOUT) | ||
return nickname | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一段是干嘛用的?
@@ -472,6 +482,7 @@ class GroupView extends React.Component { | |||
<ul className="sf-popover-list"> | |||
<li><a href="#" className="sf-popover-item" onClick={this.toggleImportMembersDialog} >{gettext('Import Members')}</a></li> | |||
<li><a href="#" className="sf-popover-item" onClick={this.toggleManageMembersDialog} >{gettext('Manage Members')}</a></li> | |||
<li><a href="#" className="sf-popover-item" onClick={this.toggleInviteMembersDialog} >{gettext('Invite Members')}</a></li> | |||
</ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里需要判断是否是多租户,以及是否是部门,来进行显示
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已更新
eb9c726
to
67b96c8
Compare
if group.creator_name == "system admin": | ||
error_msg = ' Feature disabled.' | ||
return api_error(status.HTTP_400_BAD_REQUEST, error_msg) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forbidden to operate department group
67b96c8
to
f55ebfb
Compare
No description provided.