Throw a PermissionDeniedException instead of returning false when permission should be denied
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/157efc3e Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/157efc3e Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/157efc3e Branch: refs/heads/sf-plugins Commit: 157efc3e234c76134dba1a7be110e3f2d87c29c9 Parents: fcf50ba Author: Mike Tutkowski <[email protected]> Authored: Fri Sep 18 19:26:54 2015 -0600 Committer: Mike Tutkowski <[email protected]> Committed: Fri Sep 18 19:28:24 2015 -0600 ---------------------------------------------------------------------- .../org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/157efc3e/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java ---------------------------------------------------------------------- diff --git a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java index 7ad57e6..b7658f2 100644 --- a/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java +++ b/plugins/api/solidfire/src/org/apache/cloudstack/solidfire/ApiSolidFireServiceImpl2.java @@ -502,7 +502,7 @@ public class ApiSolidFireServiceImpl2 extends AdapterBase implements APIChecker, return true; } - return false; + throw new PermissionDeniedException("User " + user.getFirstname() + " " + user.getLastname() + " cannot access the following command: " + apiCommandName); } @Override
