@@ -105,7 +105,7 @@ protected DomainChecker() {
105105 @ Override
106106 public boolean checkAccess (Account caller , Domain domain ) throws PermissionDeniedException {
107107 if (caller .getState () != Account .State .enabled ) {
108- throw new PermissionDeniedException (caller + " is disabled." );
108+ throw new PermissionDeniedException ("Account " + caller . getAccountName () + " is disabled." );
109109 }
110110
111111 if (domain == null ) {
@@ -116,10 +116,10 @@ public boolean checkAccess(Account caller, Domain domain) throws PermissionDenie
116116
117117 if (_accountService .isNormalUser (caller .getId ())) {
118118 if (caller .getDomainId () != domainId ) {
119- throw new PermissionDeniedException (caller + " does not have permission to operate within domain id=" + domain .getUuid ());
119+ throw new PermissionDeniedException ("Account " + caller . getAccountName () + " does not have permission to operate within domain id=" + domain .getUuid ());
120120 }
121121 } else if (!_domainDao .isChildDomain (caller .getDomainId (), domainId )) {
122- throw new PermissionDeniedException (caller + " does not have permission to operate within domain id=" + domain .getUuid ());
122+ throw new PermissionDeniedException ("Account " + caller . getAccountName () + " does not have permission to operate within domain id=" + domain .getUuid ());
123123 }
124124
125125 return true ;
@@ -155,7 +155,8 @@ public boolean checkAccess(Account caller, ControlledEntity entity, AccessType a
155155 // account can launch a VM from this template
156156 LaunchPermissionVO permission = _launchPermissionDao .findByTemplateAndAccount (template .getId (), caller .getId ());
157157 if (permission == null ) {
158- throw new PermissionDeniedException (caller + " does not have permission to launch instances from " + template );
158+ throw new PermissionDeniedException ("Account " + caller .getAccountName () +
159+ " does not have permission to launch instances from template " + template .getName ());
159160 }
160161 } else {
161162 // Domain admin and regular user can delete/modify only templates created by them
0 commit comments