Author: shawkins
Date: 2009-04-09 14:18:42 -0400 (Thu, 09 Apr 2009)
New Revision: 739
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerConfigAdmin.java
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerMonitoringAdmin.java
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerRuntimeStateAdmin.java
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerSecurityAdmin.java
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/AdminAuthorizationInterceptor.java
trunk/server/src/test/java/com/metamatrix/common/comm/platform/server/TestAdminAuthInterceptor.java
Log:
TEIID-275 interfaces do not directly inherit annotations, so we need to add base roles to
the server admin interfaces
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerConfigAdmin.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerConfigAdmin.java 2009-04-09
17:37:28 UTC (rev 738)
+++
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerConfigAdmin.java 2009-04-09
18:18:42 UTC (rev 739)
@@ -22,15 +22,16 @@
package com.metamatrix.admin.api.server;
-import java.util.Properties;
+import java.util.Properties;
+
+import com.metamatrix.admin.RolesAllowed;
+import com.metamatrix.admin.api.core.CoreConfigAdmin;
+import com.metamatrix.admin.api.exception.AdminException;
+import com.metamatrix.admin.api.objects.ConnectorBinding;
+import com.metamatrix.admin.api.objects.ScriptsContainer;
+import com.metamatrix.admin.api.objects.VDB;
-import com.metamatrix.admin.api.core.CoreConfigAdmin;
-import com.metamatrix.admin.api.objects.ConnectorBinding;
-import com.metamatrix.admin.api.objects.ScriptsContainer;
-import com.metamatrix.admin.api.objects.VDB;
-import com.metamatrix.admin.api.exception.AdminException;
-
/**
* Interface that exposes MetaMatrix server configuration for administration.
* <p>
@@ -38,7 +39,8 @@
* </p>
*
* @since 4.3
- */
+ */
+(a)RolesAllowed(value=AdminRoles.RoleName.ADMIN_SYSTEM)
public interface ServerConfigAdmin extends
CoreConfigAdmin {
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerMonitoringAdmin.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerMonitoringAdmin.java 2009-04-09
17:37:28 UTC (rev 738)
+++
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerMonitoringAdmin.java 2009-04-09
18:18:42 UTC (rev 739)
@@ -36,6 +36,7 @@
* should instead use {@link ServerAdmin}.</p>
* @since 4.3
*/
+(a)RolesAllowed(value=AdminRoles.RoleName.ADMIN_READONLY)
public interface ServerMonitoringAdmin extends CoreMonitoringAdmin {
/**
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerRuntimeStateAdmin.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerRuntimeStateAdmin.java 2009-04-09
17:37:28 UTC (rev 738)
+++
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerRuntimeStateAdmin.java 2009-04-09
18:18:42 UTC (rev 739)
@@ -22,6 +22,7 @@
package com.metamatrix.admin.api.server;
+import com.metamatrix.admin.RolesAllowed;
import com.metamatrix.admin.api.core.CoreRuntimeStateAdmin;
import com.metamatrix.admin.api.exception.AdminException;
@@ -33,6 +34,7 @@
* should instead use {@link ServerAdmin}.</p>
* @since 4.3
*/
+(a)RolesAllowed(value=AdminRoles.RoleName.ADMIN_PRODUCT)
public interface ServerRuntimeStateAdmin extends CoreRuntimeStateAdmin {
/**
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerSecurityAdmin.java
===================================================================
---
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerSecurityAdmin.java 2009-04-09
17:37:28 UTC (rev 738)
+++
trunk/client/src/main/java/com/metamatrix/admin/api/server/ServerSecurityAdmin.java 2009-04-09
18:18:42 UTC (rev 739)
@@ -26,6 +26,7 @@
import java.util.Collection;
import java.util.List;
+import com.metamatrix.admin.RolesAllowed;
import com.metamatrix.admin.api.core.CoreSecurityAdmin;
import com.metamatrix.admin.api.exception.AdminException;
import com.metamatrix.admin.api.objects.AdminObject;
@@ -43,6 +44,7 @@
*
* @since 4.3
*/
+(a)RolesAllowed(value=AdminRoles.RoleName.ADMIN_SYSTEM)
public interface ServerSecurityAdmin extends CoreSecurityAdmin {
/**
Modified:
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/AdminAuthorizationInterceptor.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/AdminAuthorizationInterceptor.java 2009-04-09
17:37:28 UTC (rev 738)
+++
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/AdminAuthorizationInterceptor.java 2009-04-09
18:18:42 UTC (rev 739)
@@ -30,7 +30,6 @@
import org.teiid.dqp.internal.process.DQPWorkContext;
import com.metamatrix.admin.RolesAllowed;
-import com.metamatrix.admin.api.exception.AdminProcessingException;
import com.metamatrix.admin.api.server.AdminRoles;
import com.metamatrix.api.exception.MetaMatrixProcessingException;
import com.metamatrix.api.exception.security.AuthorizationException;
Modified:
trunk/server/src/test/java/com/metamatrix/common/comm/platform/server/TestAdminAuthInterceptor.java
===================================================================
---
trunk/server/src/test/java/com/metamatrix/common/comm/platform/server/TestAdminAuthInterceptor.java 2009-04-09
17:37:28 UTC (rev 738)
+++
trunk/server/src/test/java/com/metamatrix/common/comm/platform/server/TestAdminAuthInterceptor.java 2009-04-09
18:18:42 UTC (rev 739)
@@ -72,6 +72,7 @@
return getTestServerAdmin(userRoles, iface, SimpleMock.createSimpleMock(iface));
}
+ @SuppressWarnings("unchecked")
private <T> T getTestServerAdmin(final Set<String> userRoles, Class<T>
iface, T impl) {
AuthorizationServiceInterface service =
Mockito.mock(AuthorizationServiceInterface.class);
try {
@@ -118,4 +119,12 @@
serverAdmin.getSourceDescriptors();
}
+ @Test public void testBounce_succeed() throws Exception {
+ Set<String> userRoles = new HashSet<String>();
+ userRoles.add(AdminRoles.RoleName.ADMIN_PRODUCT);
+ ServerAdmin serverAdmin = getTestServerAdmin(userRoles, ServerAdmin.class);
+ serverAdmin.bounceSystem(false);
+ }
+
+
}