Skip to content

Commit

Permalink
Merge pull request #16 from ikedam/feature/JENKINS-39023_ImprovePermi…
Browse files Browse the repository at this point in the history
…ssionMessage

[JENKINS-39023] Improve messages to diagnose permission issues
  • Loading branch information
ikedam committed Sep 12, 2020
2 parents 54ea025 + 2f896c5 commit 59cf5ed
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
SecurityContext orig = null;
if(ACL.SYSTEM.equals(Jenkins.getAuthentication()))
{
listener.getLogger().println(Messages.JobCopyBuilder_downgradeToAnonymous());
orig = ACL.impersonate(Jenkins.ANONYMOUS);
}

Expand Down Expand Up @@ -247,7 +248,10 @@ private boolean performImpl(AbstractBuild<?, ?> build, Launcher launcher, BuildL

if(fromJob == null)
{
listener.getLogger().println(String.format("Error: Item '%s' was not found.", fromJobNameExpanded));
listener.getLogger().println(Messages.JobCopyBuilder_fromJobNotFound(fromJobNameExpanded));
listener.getLogger().println(Messages.JobCopyBuilder_fromJobNotFoundNote(
Jenkins.getAuthentication().getName()
));
return false;
}
else if(!(fromJob instanceof AbstractItem))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ JobCopyBuilder.JobName.notAbstractItem=Specified item cannot be copied (does not
ReplaceOperation.fromStr.empty=Cannot be empty. Empty string results in a failure of the build.
ReplaceOperation.fromStr.enclosedWithBlank=String is surrounded with white spaces. Replacement is performed without trimming white spaces, the replacement may not work as you expects.
AdditionalFileSet.includeFile.empty=Cannot be blank.
JobCopyBuilder.downgradeToAnonymous=NOTE: This build is running as built-in SYSTEM user. Jobcopy-builder runs as an anonymous user. Configure "Access Controls of Builds" to run builds as a specific user instead of build-in SYSTEM user. See https://www.jenkins.io/doc/book/system-administration/security/build-authorization/ for more details.
JobCopyBuilder.fromJobNotFound=Error: Item ''{0}'' was not found.
JobCopyBuilder.fromJobNotFoundNote=NOTE: This may be caused for permission configurations. Jobcopy-builder for this build is now running as user ''{0}''. Please check that the item is accessible from that user.
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ ReplaceOperation.fromStr.empty=\u5024\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\
# ReplaceOperation.fromStr.enclosedWithBlank=文字列の前後に空白文字があります。前後の空白文字を含んで置き換え処理を行うので、意図した通りの動作をしない場合があります。
ReplaceOperation.fromStr.enclosedWithBlank=\u6587\u5b57\u5217\u306e\u524d\u5f8c\u306b\u7a7a\u767d\u6587\u5b57\u304c\u3042\u308a\u307e\u3059\u3002\u524d\u5f8c\u306e\u7a7a\u767d\u6587\u5b57\u3092\u542b\u3093\u3067\u7f6e\u304d\u63db\u3048\u51e6\u7406\u3092\u884c\u3046\u306e\u3067\u3001\u610f\u56f3\u3057\u305f\u901a\u308a\u306e\u52d5\u4f5c\u3092\u3057\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002
# AdditionalFileSet.includeFile.empty=値を指定してください
AdditionalFileSet.includeFile.empty=\u5024\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044
AdditionalFileSet.includeFile.empty=\u5024\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044
# JobCopyBuilder.downgradeToAnonymous=NOTE: このビルドは組み込みの SYSTEM ユーザーとして実行されているため、 Jobcopy-builder は anonymous の権限で動作します。ビルドを SYSTEM ユーザー以外の権限で実行するには管理画面で "Access Controls of Builds" を設定してください。詳細は https://www.jenkins.io/doc/book/system-administration/security/build-authorization/ を参照してください。
JobCopyBuilder.downgradeToAnonymous=NOTE: \u3053\u306E\u30D3\u30EB\u30C9\u306F\u7D44\u307F\u8FBC\u307F\u306E SYSTEM \u30E6\u30FC\u30B6\u30FC\u3068\u3057\u3066\u5B9F\u884C\u3055\u308C\u3066\u3044\u308B\u305F\u3081\u3001 Jobcopy-builder \u306F anonymous \u306E\u6A29\u9650\u3067\u52D5\u4F5C\u3057\u307E\u3059\u3002\u30D3\u30EB\u30C9\u3092 SYSTEM \u30E6\u30FC\u30B6\u30FC\u4EE5\u5916\u306E\u6A29\u9650\u3067\u5B9F\u884C\u3059\u308B\u306B\u306F\u7BA1\u7406\u753B\u9762\u3067 "Access Controls of Builds" \u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u8A73\u7D30\u306F https://www.jenkins.io/doc/book/system-administration/security/build-authorization/ \u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
# JobCopyBuilder.fromJobNotFound=Error: アイテム ''{0}'' が見つかりませんでした。
JobCopyBuilder.fromJobNotFound=Error: \u30A2\u30A4\u30C6\u30E0 ''{0}'' \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002
# JobCopyBuilder.fromJobNotFoundNote=権限設定によりアイテムへのアクセスが許可されていないのかもしれません。Jobcopy-builder は現在ユーザー ''{0}'' として実行されています。このユーザーに対して対象のアイテムへのアクセス許可が許可されていることを確認してください。
JobCopyBuilder.fromJobNotFoundNote=\u6A29\u9650\u8A2D\u5B9A\u306B\u3088\u308A\u30A2\u30A4\u30C6\u30E0\u3078\u306E\u30A2\u30AF\u30BB\u30B9\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u306A\u3044\u306E\u304B\u3082\u3057\u308C\u307E\u305B\u3093\u3002Jobcopy-builder \u306F\u73FE\u5728\u30E6\u30FC\u30B6\u30FC ''{0}'' \u3068\u3057\u3066\u5B9F\u884C\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u3053\u306E\u30E6\u30FC\u30B6\u30FC\u306B\u5BFE\u3057\u3066\u5BFE\u8C61\u306E\u30A2\u30A4\u30C6\u30E0\u3078\u306E\u30A2\u30AF\u30BB\u30B9\u8A31\u53EF\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002

0 comments on commit 59cf5ed

Please sign in to comment.