File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Open diff view settings
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Open diff view settings
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments