Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7a93768

Browse filesBrowse files
committed
项目权限
1 parent 106116a commit 7a93768
Copy full SHA for 7a93768

File tree

Expand file treeCollapse file tree

2 files changed

+20
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+20
-0
lines changed
Open diff view settings
Collapse file

‎Coding_iOS/Controllers/ProjectMemberActivityListViewController.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Controllers/ProjectMemberActivityListViewController.m
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ - (void)goToVCWithItem:(HtmlMediaItem *)clickedItem activity:(ProjectActivity *)
168168
[NSObject showHudTipStr:@"没找到 Fork 到哪里去了~"];
169169
}
170170
}else if ([proAct.action isEqualToString:@"push"]){
171+
// current_user_role_id = 75 是受限成员,不可访问代码
172+
if (project.current_user_role_id.integerValue <= 75) {
173+
[NSObject showHudTipStr:@"无权访问项目代码相关功能"];
174+
return;
175+
}
171176
if (proAct.commits.count == 1) {
172177
Commit *firstCommit = [proAct.commits firstObject];
173178
NSString *request_path = [NSString stringWithFormat:@"%@/commit/%@", proAct.depot.path, firstCommit.sha];
@@ -187,6 +192,11 @@ - (void)goToVCWithItem:(HtmlMediaItem *)clickedItem activity:(ProjectActivity *)
187192
}else if ([target_type isEqualToString:@"PullRequestBean"] ||
188193
[target_type isEqualToString:@"MergeRequestBean"] ||
189194
[target_type isEqualToString:@"CommitLineNote"]){
195+
// current_user_role_id = 75 是受限成员,不可访问代码
196+
if (project.current_user_role_id.integerValue <= 75) {
197+
[NSObject showHudTipStr:@"无权访问项目代码相关功能"];
198+
return;
199+
}
190200
NSString *request_path;
191201
if ([target_type isEqualToString:@"PullRequestBean"]){
192202
request_path = proAct.pull_request_path;
Collapse file

‎Coding_iOS/Controllers/ProjectViewController.m‎

Copy file name to clipboardExpand all lines: Coding_iOS/Controllers/ProjectViewController.m
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,11 @@ - (void)goToVCWithItem:(HtmlMediaItem *)clickedItem activity:(ProjectActivity *)
441441
[NSObject showHudTipStr:@"没找到 Fork 到哪里去了~"];
442442
}
443443
}else if ([proAct.action isEqualToString:@"push"]){
444+
// current_user_role_id = 75 是受限成员,不可访问代码
445+
if (project.current_user_role_id.integerValue <= 75) {
446+
[NSObject showHudTipStr:@"无权访问项目代码相关功能"];
447+
return;
448+
}
444449
if (proAct.commits.count == 1) {
445450
Commit *firstCommit = [proAct.commits firstObject];
446451
NSString *request_path = [NSString stringWithFormat:@"%@/commit/%@", proAct.depot.path, firstCommit.sha];
@@ -460,6 +465,11 @@ - (void)goToVCWithItem:(HtmlMediaItem *)clickedItem activity:(ProjectActivity *)
460465
}else if ([target_type isEqualToString:@"PullRequestBean"] ||
461466
[target_type isEqualToString:@"MergeRequestBean"] ||
462467
[target_type isEqualToString:@"CommitLineNote"]){
468+
// current_user_role_id = 75 是受限成员,不可访问代码
469+
if (project.current_user_role_id.integerValue <= 75) {
470+
[NSObject showHudTipStr:@"无权访问项目代码相关功能"];
471+
return;
472+
}
463473
NSString *request_path;
464474
if ([target_type isEqualToString:@"PullRequestBean"]){
465475
request_path = proAct.pull_request_path;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.