modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java | 10 +- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java | 36 ---------- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleGroupsStep.java | 13 +-- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java | 6 - modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 6 + modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties | 4 + modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 6 + modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 4 + modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties | 6 + modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 4 + modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties | 6 + modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 6 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java | 8 -- 13 files changed, 56 insertions(+), 59 deletions(-)
New commits: commit 51e7603225aab6f19de163c50333313b537fb5de Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Aug 22 11:24:04 2013 -0400
- Fix some error handling workflows - Complete I18N support
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java index 4613477..81ad9cc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/AbstractBundleCreateWizard.java @@ -110,7 +110,7 @@ public abstract class AbstractBundleCreateWizard extends AbstractWizard { public void cancel() { final BundleVersion bv = getBundleVersion(); if (bv != null) { - // the user must have created it already after verification step, delete it + // the user must have created it already after verification step, delete it, if possible BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); bundleServer.deleteBundleVersion(bv.getId(), true, new AsyncCallback<Void>() { public void onSuccess(Void result) { @@ -120,8 +120,12 @@ public abstract class AbstractBundleCreateWizard extends AbstractWizard { }
public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError( - MSG.view_bundle_createWizard_cancelFailure(bv.getName(), bv.getVersion()), caught); + String msg = MSG.view_bundle_createWizard_cancelFailure(bv.getName(), bv.getVersion()); + // provide a more specific message if the cancel failed due to the user not having delete permission + if (caught.getMessage().contains("PermissionException")) { + msg = MSG.view_bundle_createWizard_cancelFailurePerm(bv.getName(), bv.getVersion()); + } + CoreGUI.getErrorHandler().handleError(msg, caught); } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java index cfc568a..b638625 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleCreateWizard.java @@ -44,40 +44,4 @@ public class BundleCreateWizard extends AbstractBundleCreateWizard { steps.add(new BundleSummaryStep(this)); setSteps(steps); } - - // @Override - // public void startWizard() { - // BundleGWTServiceAsync bundleServer = GWTServiceLookup.getBundleService(); - // - // if (globalPermissions.contains(Permission.VIEW_BUNDLES)) { - // bundleServer.findBundleGroupsByCriteria(new BundleGroupCriteria(), - // new AsyncCallback<PageList<BundleGroup>>() { - // public void onSuccess(PageList<BundleGroup> result) { - // - // } - // - // public void onFailure(Throwable caught) { - // // TODO - // } - // }); - // - // } else { - // - // bundleServer.getCreateBundleGroups(new AsyncCallback<HashSet<BundleGroup>>() { - // public void onSuccess(HashSet<BundleGroup> result) { - // - // } - // - // public void onFailure(Throwable caught) { - // // TODO - // } - // }); - // - // - // // TODO Auto-generated method stub - // super.startWizard(); - // - // } - // - // } } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleGroupsStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleGroupsStep.java index 487aedb..f19153d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleGroupsStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleGroupsStep.java @@ -338,19 +338,18 @@ public class BundleGroupsStep extends AbstractWizardStep { .getBundle().getId() }, new AsyncCallback<Void>() { @Override public void onSuccess(Void result) { - // I18N CoreGUI.getMessageCenter().notify( - new Message("MSG.view_bundle_createWizard_assignSuccessful(result.getName(), result.getVersion())", - Message.Severity.Info)); + new Message(MSG.view_bundle_createWizard_groupsStep_successAssign(wizard.getBundleVersion() + .getBundle().getName(), wizard.getBundleVersion().getName()), Message.Severity.Info)); wizard.getView().incrementStep(); // go to the next step }
@Override public void onFailure(Throwable caught) { - wizard.getView().showMessage(caught.getMessage()); - CoreGUI.getErrorHandler().handleError(MSG.view_bundle_createWizard_createFailure(), caught); - wizard.setBundleVersion(null); - wizard.setCreateInitialBundleVersionRecipe(""); + String msg = MSG.view_bundle_createWizard_groupsStep_failedAssign(wizard.getBundleVersion().getBundle() + .getName(), wizard.getBundleVersion().getName()); + wizard.getView().showMessage(msg); + CoreGUI.getErrorHandler().handleError(msg, caught); } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java index f86adff..3a0cdfd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/create/BundleUploadDistroFileStep.java @@ -327,11 +327,11 @@ public class BundleUploadDistroFileStep extends AbstractWizardStep {
public void onFailure(Throwable caught) { setButtonsDisableMode(false); - // TODO NEW MESSAGE - CoreGUI.getErrorHandler().handleError("Failed to determine assignable bundle groups.", caught); + String message = MSG.view_bundle_createWizard_groupsStep_failedGetAssignable(); + wizard.getView().showMessage(message); + CoreGUI.getErrorHandler().handleError(message, caught); } }); - }
private void processUpload() { diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties index b44a67f..ba07960 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties @@ -1213,7 +1213,8 @@ view_bundle_bundleType = Bundle Type view_bundle_bundleVersion = Bundle Version view_bundle_bundleVersions = Bundle Versions view_bundle_createWizard_bundleDistro = Bundle Distribution -view_bundle_createWizard_cancelFailure = Failed to fully cancel the creation of bundle [{0}], version = [{1}] - the bundle may still exist in the database +view_bundle_createWizard_cancelFailure = Failed to fully cancel the creation of bundle [{0}], version = [{1}] - the bundle may still exist. +view_bundle_createWizard_cancelFailurePerm = Failed to fully cancel the creation of bundle [{0}], version = [{1}] because the user has create but not delete permissions. The bundle will likley need to be removed by an administrator. view_bundle_createWizard_cancelSuccessful = Canceled the creation of bundle [{0}], version = [{1}] view_bundle_createWizard_clickToUploadRecipe = Click to load a recipe file view_bundle_createWizard_createFailure = Failed to create the bundle @@ -1224,11 +1225,14 @@ view_bundle_createWizard_failedToUploadDistroFile = Failed to upload bundle dist view_bundle_createWizard_failedToUploadFile = Failed to upload bundle file view_bundle_createWizard_groupsStep_assign = Assign at least one of the eligible bundle groups: view_bundle_createWizard_groupsStep_assigned = The new bundle version is for an existing bundle and inherits its bundle group assignments: +view_bundle_createWizard_groupsStep_failedAssign = Failed to assigned initial bundle groups to a bundle named [{0}] with a version of [{1}]. Please cancel the create wizard and notify your administrator. +view_bundle_createWizard_groupsStep_failedGetAssignable = Failed to determine assignable bundle groups. Please cancel the create wizard and notify your administrator. view_bundle_createWizard_groupsStep_help = A new bundle is created when uploading the first version for that bundle. The new bundle is then assigned to its initial bundle groups. A user can only assign the new bundle to bundle groups for which he has Create Bundles permission, either global or at the bundle group level. At least one bundle group must be assigned unless the user has global Create and global View Bundles permission, in which case it can be left unassigned. view_bundle_createWizard_groupsStep_leaveUnassigned = Leave the new bundle unsassigned. view_bundle_createWizard_groupsStep_noAssignable = Unable to create initial bundle version because the user has no bundle groups to which it can be assigned. Please cancel the create wizard and notify your administrator. view_bundle_createWizard_groupsStep_noneAssigned = The new bundle version must be assigned to at least one bundle group! view_bundle_createWizard_groupsStep_radioTitle = Initial bundle group assignment for the new bundle +view_bundle_createWizard_groupsStep_successAssign = You have successfully assigned initial bundle groups to a bundle named [{0}] with a version of [{1}] view_bundle_createWizard_groupsStep_unassigned = The new bundle version is for an existing bundle and inherits its bundle group assignments. The bundle is not currently assigned to any bundle groups. view_bundle_createWizard_loadBundleFileFailure = Cannot obtain bundle file information from server view_bundle_createWizard_noAdditionalFilesNeeded = No additional files need to be uploaded for this bundle diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties index 7ce4b17..bdb265a 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties @@ -1228,6 +1228,7 @@ view_bundle_bundleVersion = Verze balíku view_bundle_bundleVersions = Verze balíku view_bundle_createWizard_bundleDistro = Distribuce balíku view_bundle_createWizard_cancelFailure = Nepodařilo se zrušit vytváření balíku [{0}], verze = [{1}] - balík může stále existovat v databázi +##view_bundle_createWizard_cancelFailurePerm = Failed to fully cancel the creation of bundle [{0}], version = [{1}] because the user has create but not delete permissions. The bundle will likley need to be removed by an administrator. view_bundle_createWizard_cancelSuccessful = Zrušeno vytváření balíku [{0}], verze = [{1}] view_bundle_createWizard_clickToUploadRecipe = Klikněte pro nahrání souboru s receptem view_bundle_createWizard_createFailure = Nepodařilo se vytvořit balík @@ -1238,11 +1239,14 @@ view_bundle_createWizard_failedToUploadDistroFile = Nepodařilo se nahrát distr view_bundle_createWizard_failedToUploadFile = Nepodařilo se nahrát soubor balíku ##view_bundle_createWizard_groupsStep_assign = Assign at least one of the eligible bundle groups: ##view_bundle_createWizard_groupsStep_assigned = The new bundle version is for an existing bundle and inherits its bundle group assignments: +##view_bundle_createWizard_groupsStep_failedAssign = Failed to assigned initial bundle groups to a bundle named [{0}] with a version of [{1}]. Please cancel the create wizard and notify your administrator. +##view_bundle_createWizard_groupsStep_failedGetAssignable = Failed to determine assignable bundle groups. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_help = A new bundle is created when uploading the first version for that bundle. The new bundle is then assigned to its initial bundle groups. A user can only assign the new bundle to bundle groups for which he has Create Bundles permission, either global or at the bundle group level. At least one bundle group must be assigned unless the user has global Create and global View Bundles permission, in which case it can be left unassigned. ##view_bundle_createWizard_groupsStep_leaveUnassigned = Leave the new bundle unsassigned. ##view_bundle_createWizard_groupsStep_noAssignable = Unable to create initial bundle version because the user has no bundle groups to which it can be assigned. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_noneAssigned = The new bundle version must be assigned to at least one bundle group! ##view_bundle_createWizard_groupsStep_radioTitle = Initial bundle group assignment for the new bundle +##view_bundle_createWizard_groupsStep_successAssign = You have successfully assigned initial bundle groups to a bundle named [{0}] with a version of [{1}] ##view_bundle_createWizard_groupsStep_unassigned = The new bundle version is for an existing bundle and inherits its bundle group assignments. The bundle is not currently assigned to any bundle groups. view_bundle_createWizard_loadBundleFileFailure = Nepodařilo se získat soubor s informacemi o balíku ze serveru view_bundle_createWizard_noAdditionalFilesNeeded = Žádné dodatečné soubory nejsou potřeba pro tento balík diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties index 6b5e006..f4743a9 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties @@ -1130,7 +1130,8 @@ view_bundle_bundleType = Bundle-Type view_bundle_bundleVersion = Bundle-Version view_bundle_bundleVersions = Bundle-Versionen ##view_bundle_createWizard_bundleDistro = Bundle Distribution -##view_bundle_createWizard_cancelFailure = Failed to fully cancel the creation of bundle [{0}], version=[{1}] - the bundle may still exist in the database +##view_bundle_createWizard_cancelFailure = Failed to fully cancel the creation of bundle [{0}], version=[{1}] - the bundle may still exist. +##view_bundle_createWizard_cancelFailurePerm = Failed to fully cancel the creation of bundle [{0}], version = [{1}] because the user has create but not delete permissions. The bundle will likley need to be removed by an administrator. ##view_bundle_createWizard_cancelSuccessful = Canceled the creation of bundle [{0}], version=[{1}] ##view_bundle_createWizard_clickToUploadRecipe = Click to upload a recipe file ##view_bundle_createWizard_createFailure = Failed to create the bundle @@ -1141,11 +1142,14 @@ view_bundle_bundleVersions = Bundle-Versionen ##view_bundle_createWizard_failedToUploadFile = Failed to upload bundle file ##view_bundle_createWizard_groupsStep_assign = Assign at least one of the eligible bundle groups: ##view_bundle_createWizard_groupsStep_assigned = The new bundle version is for an existing bundle and inherits its bundle group assignments: +##view_bundle_createWizard_groupsStep_failedAssign = Failed to assigned initial bundle groups to a bundle named [{0}] with a version of [{1}]. Please cancel the create wizard and notify your administrator. +##view_bundle_createWizard_groupsStep_failedGetAssignable = Failed to determine assignable bundle groups. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_help = A new bundle is created when uploading the first version for that bundle. The new bundle is then assigned to its initial bundle groups. A user can only assign the new bundle to bundle groups for which he has Create Bundles permission, either global or at the bundle group level. At least one bundle group must be assigned unless the user has global Create and global View Bundles permission, in which case it can be left unassigned. ##view_bundle_createWizard_groupsStep_leaveUnassigned = Leave the new bundle unsassigned. ##view_bundle_createWizard_groupsStep_noAssignable = Unable to create initial bundle version because the user has no bundle groups to which it can be assigned. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_noneAssigned = The new bundle version must be assigned to at least one bundle group! ##view_bundle_createWizard_groupsStep_radioTitle = Initial bundle group assignment for the new bundle +##view_bundle_createWizard_groupsStep_successAssign = You have successfully assigned initial bundle groups to a bundle named [{0}] with a version of [{1}] ##view_bundle_createWizard_groupsStep_unassigned = The new bundle version is for an existing bundle and inherits its bundle group assignments. The bundle is not currently assigned to any bundle groups. ##view_bundle_createWizard_loadBundleFileFailure = Cannot obtain bundle file information from server ##view_bundle_createWizard_noAdditionalFilesNeeded = No additional files need to be uploaded for this bundle diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties index 554c47c..7f6465b 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties @@ -1203,6 +1203,7 @@ view_bundle_bundleVersion = バンドルバージョン view_bundle_bundleVersions = バンドルバージョン view_bundle_createWizard_bundleDistro = バンドル配布 view_bundle_createWizard_cancelFailure = バンドル [{0}], バージョン = [{1}] の作成の完全なキャンセルに失敗しました - バンドルはデータベースにまだ残っているかもしれません +##view_bundle_createWizard_cancelFailurePerm = Failed to fully cancel the creation of bundle [{0}], version = [{1}] because the user has create but not delete permissions. The bundle will likley need to be removed by an administrator. view_bundle_createWizard_cancelSuccessful = バンドル [{0}], バージョン = [{1}] の作成をキャンセルしました view_bundle_createWizard_clickToUploadRecipe = レシピファイルのロードするためにクリックしてください view_bundle_createWizard_createFailure = バンドルを作成するのに失敗しました @@ -1213,11 +1214,14 @@ view_bundle_createWizard_failedToUploadDistroFile = バンドル配布ファイ view_bundle_createWizard_failedToUploadFile = バンドルファイルのアップロードに失敗しました ##view_bundle_createWizard_groupsStep_assign = Assign at least one of the eligible bundle groups: ##view_bundle_createWizard_groupsStep_assigned = The new bundle version is for an existing bundle and inherits its bundle group assignments: +##view_bundle_createWizard_groupsStep_failedAssign = Failed to assigned initial bundle groups to a bundle named [{0}] with a version of [{1}]. Please cancel the create wizard and notify your administrator. +##view_bundle_createWizard_groupsStep_failedGetAssignable = Failed to determine assignable bundle groups. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_help = A new bundle is created when uploading the first version for that bundle. The new bundle is then assigned to its initial bundle groups. A user can only assign the new bundle to bundle groups for which he has Create Bundles permission, either global or at the bundle group level. At least one bundle group must be assigned unless the user has global Create and global View Bundles permission, in which case it can be left unassigned. ##view_bundle_createWizard_groupsStep_leaveUnassigned = Leave the new bundle unsassigned. ##view_bundle_createWizard_groupsStep_noAssignable = Unable to create initial bundle version because the user has no bundle groups to which it can be assigned. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_noneAssigned = The new bundle version must be assigned to at least one bundle group! ##view_bundle_createWizard_groupsStep_radioTitle = Initial bundle group assignment for the new bundle +##view_bundle_createWizard_groupsStep_successAssign = You have successfully assigned initial bundle groups to a bundle named [{0}] with a version of [{1}] ##view_bundle_createWizard_groupsStep_unassigned = The new bundle version is for an existing bundle and inherits its bundle group assignments. The bundle is not currently assigned to any bundle groups. view_bundle_createWizard_loadBundleFileFailure = サーバーからバンドルファイル情報の取得ができません view_bundle_createWizard_noAdditionalFilesNeeded = このバンドルのためにアップロードされる必要がある追加ファイルはありません diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties index 09cff8a..f70aaa9 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ko.properties @@ -1077,7 +1077,8 @@ view_bundle_bundleFiles = 번들 파일 view_bundle_bundleVersion = 번들 버전 view_bundle_bundleVersions = 번들 버전 view_bundle_createWizard_bundleDistro = 번들 배포 -##view_bundle_createWizard_cancelFailure = Failed to fully cancel the creation of bundle [{0}], version = [{1}] - the bundle may still exist in the database +##view_bundle_createWizard_cancelFailure = Failed to fully cancel the creation of bundle [{0}], version = [{1}] - the bundle may still exist. +##view_bundle_createWizard_cancelFailurePerm = Failed to fully cancel the creation of bundle [{0}], version = [{1}] because the user has create but not delete permissions. The bundle will likley need to be removed by an administrator. view_bundle_createWizard_cancelSuccessful = 번들 [{0}], 버전 = [{1}]의 생성을 취소했습니다. view_bundle_createWizard_clickToUploadRecipe = 레시피 파일을 로드하기 위해 클릭하십시오 view_bundle_createWizard_createFailure = 번들 생성에 실패했습니다 @@ -1088,11 +1089,14 @@ view_bundle_createWizard_enterUrl = Please enter a valid URL from where the bund ##view_bundle_createWizard_failedToUploadFile = Failed to upload bundle file ##view_bundle_createWizard_groupsStep_assign = Assign at least one of the eligible bundle groups: ##view_bundle_createWizard_groupsStep_assigned = The new bundle version is for an existing bundle and inherits its bundle group assignments: +##view_bundle_createWizard_groupsStep_failedAssign = Failed to assigned initial bundle groups to a bundle named [{0}] with a version of [{1}]. Please cancel the create wizard and notify your administrator. +##view_bundle_createWizard_groupsStep_failedGetAssignable = Failed to determine assignable bundle groups. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_help = A new bundle is created when uploading the first version for that bundle. The new bundle is then assigned to its initial bundle groups. A user can only assign the new bundle to bundle groups for which he has Create Bundles permission, either global or at the bundle group level. At least one bundle group must be assigned unless the user has global Create and global View Bundles permission, in which case it can be left unassigned. ##view_bundle_createWizard_groupsStep_leaveUnassigned = Leave the new bundle unsassigned. ##view_bundle_createWizard_groupsStep_noAssignable = Unable to create initial bundle version because the user has no bundle groups to which it can be assigned. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_noneAssigned = The new bundle version must be assigned to at least one bundle group! ##view_bundle_createWizard_groupsStep_radioTitle = Initial bundle group assignment for the new bundle +##view_bundle_createWizard_groupsStep_successAssign = You have successfully assigned initial bundle groups to a bundle named [{0}] with a version of [{1}] ##view_bundle_createWizard_groupsStep_unassigned = The new bundle version is for an existing bundle and inherits its bundle group assignments. The bundle is not currently assigned to any bundle groups. view_bundle_createWizard_loadBundleFileFailure = 서버에서 번들 파일 정보를 획득 할 수 없습니다 ##view_bundle_createWizard_noAdditionalFilesNeeded = No additional files need to be uploaded for this bundle diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties index bf7a092..3a841ad 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties @@ -1216,6 +1216,7 @@ view_bundle_bundleVersion = Vers\u00E3o do Bundle view_bundle_bundleVersions = Vers\u00F5es do Bundle view_bundle_createWizard_bundleDistro = Distribui\u00E7\u00E3o do Bundle view_bundle_createWizard_cancelFailure = Falha ao cancelar a cria\u00E7\u00E3o do bundle [{0}], vers\u00E3o = [{1}] - talvez o bundle ainda esteja gravado no banco de dados +##view_bundle_createWizard_cancelFailurePerm = Failed to fully cancel the creation of bundle [{0}], version = [{1}] because the user has create but not delete permissions. The bundle will likley need to be removed by an administrator. view_bundle_createWizard_cancelSuccessful = Cria\u00E7\u00E3o do bundle [{0}] cancelada, vers\u00E3o = [{1}] view_bundle_createWizard_clickToUploadRecipe = Clique para fazer o upload do arquivo de script view_bundle_createWizard_createFailure = Falha ao criar o bundle @@ -1226,11 +1227,14 @@ view_bundle_createWizard_failedToUploadDistroFile = Falha ao fazer o upload do a view_bundle_createWizard_failedToUploadFile = Falha ao fazer o upload do bundle ##view_bundle_createWizard_groupsStep_assign = Assign at least one of the eligible bundle groups: ##view_bundle_createWizard_groupsStep_assigned = The new bundle version is for an existing bundle and inherits its bundle group assignments: +##view_bundle_createWizard_groupsStep_failedAssign = Failed to assigned initial bundle groups to a bundle named [{0}] with a version of [{1}]. Please cancel the create wizard and notify your administrator. +##view_bundle_createWizard_groupsStep_failedGetAssignable = Failed to determine assignable bundle groups. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_help = A new bundle is created when uploading the first version for that bundle. The new bundle is then assigned to its initial bundle groups. A user can only assign the new bundle to bundle groups for which he has Create Bundles permission, either global or at the bundle group level. At least one bundle group must be assigned unless the user has global Create and global View Bundles permission, in which case it can be left unassigned. ##view_bundle_createWizard_groupsStep_leaveUnassigned = Leave the new bundle unsassigned. ##view_bundle_createWizard_groupsStep_noAssignable = Unable to create initial bundle version because the user has no bundle groups to which it can be assigned. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_noneAssigned = The new bundle version must be assigned to at least one bundle group! ##view_bundle_createWizard_groupsStep_radioTitle = Initial bundle group assignment for the new bundle +##view_bundle_createWizard_groupsStep_successAssign = You have successfully assigned initial bundle groups to a bundle named [{0}] with a version of [{1}] ##view_bundle_createWizard_groupsStep_unassigned = The new bundle version is for an existing bundle and inherits its bundle group assignments. The bundle is not currently assigned to any bundle groups. view_bundle_createWizard_loadBundleFileFailure = N\u00E3o foi poss\u00EDvel obter infoma\u00E7\u00F5es sobre o arquivo de bundle view_bundle_createWizard_noAdditionalFilesNeeded = N\u00E3o \u00E9 necess\u00E1rio fazer upload de mais arquivos para este bundle diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties index 99bc501..c344361 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties @@ -2777,7 +2777,8 @@ view_admin_systemSettings_LDAPBindPW_name = Пароль ##view_bundleGroup_deletesFailure = Failed to delete the bundle groups ##view_bundleGroup_deletesSuccessful = You successfully deleted the bundle groups ##view_bundle_createWizard_bundleDistro = Bundle Distribution -##view_bundle_createWizard_cancelFailure = Failed to fully cancel the creation of bundle [{0}], version = [{1}] - the bundle may still exist in the database +##view_bundle_createWizard_cancelFailure = Failed to fully cancel the creation of bundle [{0}], version = [{1}] - the bundle may still exist. +##view_bundle_createWizard_cancelFailurePerm = Failed to fully cancel the creation of bundle [{0}], version = [{1}] because the user has create but not delete permissions. The bundle will likley need to be removed by an administrator. ##view_bundle_createWizard_cancelSuccessful = Canceled the creation of bundle [{0}], version = [{1}] ##view_bundle_createWizard_clickToUploadRecipe = Click to load a recipe file ##view_bundle_createWizard_createFailure = Failed to create the bundle @@ -2788,11 +2789,14 @@ view_admin_systemSettings_LDAPBindPW_name = Пароль ##view_bundle_createWizard_failedToUploadFile = Failed to upload bundle file ##view_bundle_createWizard_groupsStep_assign = Assign at least one of the eligible bundle groups: ##view_bundle_createWizard_groupsStep_assigned = The new bundle version is for an existing bundle and inherits its bundle group assignments: +##view_bundle_createWizard_groupsStep_failedAssign = Failed to assigned initial bundle groups to a bundle named [{0}] with a version of [{1}]. Please cancel the create wizard and notify your administrator. +##view_bundle_createWizard_groupsStep_failedGetAssignable = Failed to determine assignable bundle groups. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_help = A new bundle is created when uploading the first version for that bundle. The new bundle is then assigned to its initial bundle groups. A user can only assign the new bundle to bundle groups for which he has Create Bundles permission, either global or at the bundle group level. At least one bundle group must be assigned unless the user has global Create and global View Bundles permission, in which case it can be left unassigned. ##view_bundle_createWizard_groupsStep_leaveUnassigned = Leave the new bundle unsassigned. ##view_bundle_createWizard_groupsStep_noAssignable = Unable to create initial bundle version because the user has no bundle groups to which it can be assigned. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_noneAssigned = The new bundle version must be assigned to at least one bundle group! ##view_bundle_createWizard_groupsStep_radioTitle = Initial bundle group assignment for the new bundle +##view_bundle_createWizard_groupsStep_successAssign = You have successfully assigned initial bundle groups to a bundle named [{0}] with a version of [{1}] ##view_bundle_createWizard_groupsStep_unassigned = The new bundle version is for an existing bundle and inherits its bundle group assignments. The bundle is not currently assigned to any bundle groups. ##view_bundle_createWizard_loadBundleFileFailure = Cannot obtain bundle file information from server ##view_bundle_createWizard_noAdditionalFilesNeeded = No additional files need to be uploaded for this bundle diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties index dd1aaf0..13616b0 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties @@ -1199,7 +1199,8 @@ view_bundle_bundleType = Bundle\u7c7b\u578b view_bundle_bundleVersion = Bundle\u7248\u672c view_bundle_bundleVersions = Bundle\u7248\u672c view_bundle_createWizard_bundleDistro = Bundle\u53d1\u5e03 -##view_bundle_createWizard_cancelFailure = Failed to fully cancel the creation of bundle [{0}], version = [{1}] - the bundle may still exist in the database +##view_bundle_createWizard_cancelFailure = Failed to fully cancel the creation of bundle [{0}], version = [{1}] - the bundle may still exist. +##view_bundle_createWizard_cancelFailurePerm = Failed to fully cancel the creation of bundle [{0}], version = [{1}] because the user has create but not delete permissions. The bundle will likley need to be removed by an administrator. ##view_bundle_createWizard_cancelSuccessful = Canceled the creation of bundle [{0}], version = [{1}] ##view_bundle_createWizard_clickToUploadRecipe = Click to load a recipe file view_bundle_createWizard_createFailure = \u521b\u5efabundle\u5931\u8d25 @@ -1210,11 +1211,14 @@ view_bundle_createWizard_failedToUploadDistroFile = \u4e0a\u4f20bundle\u53d1\u5e view_bundle_createWizard_failedToUploadFile = \u4e0a\u4f20bundle\u6587\u4ef6\u5931\u8d25 ##view_bundle_createWizard_groupsStep_assign = Assign at least one of the eligible bundle groups: ##view_bundle_createWizard_groupsStep_assigned = The new bundle version is for an existing bundle and inherits its bundle group assignments: +##view_bundle_createWizard_groupsStep_failedAssign = Failed to assigned initial bundle groups to a bundle named [{0}] with a version of [{1}]. Please cancel the create wizard and notify your administrator. +##view_bundle_createWizard_groupsStep_failedGetAssignable = Failed to determine assignable bundle groups. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_help = A new bundle is created when uploading the first version for that bundle. The new bundle is then assigned to its initial bundle groups. A user can only assign the new bundle to bundle groups for which he has Create Bundles permission, either global or at the bundle group level. At least one bundle group must be assigned unless the user has global Create and global View Bundles permission, in which case it can be left unassigned. ##view_bundle_createWizard_groupsStep_leaveUnassigned = Leave the new bundle unsassigned. ##view_bundle_createWizard_groupsStep_noAssignable = Unable to create initial bundle version because the user has no bundle groups to which it can be assigned. Please cancel the create wizard and notify your administrator. ##view_bundle_createWizard_groupsStep_noneAssigned = The new bundle version must be assigned to at least one bundle group!: ##view_bundle_createWizard_groupsStep_radioTitle = Initial bundle group assignment for the new bundle +##view_bundle_createWizard_groupsStep_successAssign = You have successfully assigned initial bundle groups to a bundle named [{0}] with a version of [{1}] ##view_bundle_createWizard_groupsStep_unassigned = The new bundle version is for an existing bundle and inherits its bundle group assignments. The bundle is not currently assigned to any bundle groups. view_bundle_createWizard_loadBundleFileFailure = \u65e0\u6cd5\u4ece\u670d\u52a1\u5668\u83b7\u5f97bundle\u6587\u4ef6\u4fe1\u606f view_bundle_createWizard_noAdditionalFilesNeeded = No additional files need to be uploaded for this bundle
commit ec3577bde2763d9717a22914248a2e510f7b7b3c Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Aug 22 11:22:57 2013 -0400
Fix issue with perm check in get assignable bundles
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java index 2e44e52..ae30f11 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerBean.java @@ -2511,11 +2511,9 @@ public class BundleManagerBean implements BundleManagerLocal, BundleManagerRemot
} else { // if necessary, make sure the bundle is viewable - if (!hasViewBundles) { - if (authorizationManager.canViewBundle(assigningSubject, bundleId)) { - throw new PermissionException("Bundle ID [" + bundleId + "] is not viewable by subject [" - + assigningSubject.getName() + "]"); - } + if (!hasViewBundles && !authorizationManager.canViewBundle(assigningSubject, bundleId)) { + throw new PermissionException("Bundle ID [" + bundleId + "] is not viewable by subject [" + + assigningSubject.getName() + "]"); }
// can assign to bundle groups for which he has create_bundles_in_group or assign_bundles_to_group
rhq-commits@lists.fedorahosted.org