java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/keys/CryptoKeysHandler.java | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit 1dae339f2c4ef314436bddc3bf9364dbf526bacd Author: Tomas Kasparek tkasparek@redhat.com Date: Mon Aug 27 16:13:04 2012 +0200
733420 - Checking user permissions for CryptoKeysHandler
Added calls of ensureOrgOrConfigAdmin so CryptoKeysHandler methods are only available to org or config admins.
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/keys/CryptoKeysHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/keys/CryptoKeysHandler.java index 7bd5b8b..426cdf2 100644 --- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/keys/CryptoKeysHandler.java +++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/keys/CryptoKeysHandler.java @@ -63,6 +63,8 @@ public class CryptoKeysHandler extends BaseHandler { throw new NoSuchUserException(); }
+ ensureOrgOrConfigAdmin(loggedInUser); + Org org = loggedInUser.getOrg(); KickstartLister lister = KickstartLister.getInstance();
@@ -95,6 +97,8 @@ public class CryptoKeysHandler extends BaseHandler { throw new NoSuchUserException(); }
+ ensureOrgOrConfigAdmin(loggedInUser); + Org org = loggedInUser.getOrg(); CreateCryptoKeyCommand command = new CreateCryptoKeyCommand(org); command.setType(type); @@ -129,6 +133,8 @@ public class CryptoKeysHandler extends BaseHandler { throw new NoSuchUserException(); }
+ ensureOrgOrConfigAdmin(loggedInUser); + DeleteCryptoKeyCommand command = new DeleteCryptoKeyCommand(loggedInUser, description);
@@ -201,6 +207,8 @@ public class CryptoKeysHandler extends BaseHandler { public CryptoKey getDetails(String sessionKey, String description) { User loggedInUser = getLoggedInUser(sessionKey);
+ ensureOrgOrConfigAdmin(loggedInUser); + EditCryptoKeyCommand command = new EditCryptoKeyCommand(loggedInUser, description);
CryptoKey key = command.getCryptoKey();
spacewalk-commits@lists.fedorahosted.org