Skip to content

Commit

Permalink
Optimize the download code for shared user readable
Browse files Browse the repository at this point in the history
  • Loading branch information
ningyougang committed May 28, 2021
1 parent c00f5f6 commit 51ca755
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,10 @@ protected[core] abstract class EntitlementProvider(
.map(value => value.convertTo[String])
.getOrElse(WhiskAction.defaultPermissions)

val errorInfo = s"have no permission to download this shared action"
val currentDownloadPermission = currentPermissions.charAt(3)
if (user.namespace.name.asString != entityName.path.root.asString) { // the shared user who download the action
if (currentDownloadPermission == '-') {
val errorInfo = s"have no permission to download this shared action"
val downloadPermissionOfSharedUser = currentPermissions.charAt(3)
if (downloadPermissionOfSharedUser == '-') {
Future.failed(RejectRequest(Forbidden, Some(ErrorResponse(errorInfo, transid))))
} else {
Future.successful(())
Expand Down

0 comments on commit 51ca755

Please sign in to comment.