[jboss-cvs] JBossAS SVN: r80953 - projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/plugins/javaee.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Nov 13 15:41:23 EST 2008
Author: anil.saldhana at jboss.com
Date: 2008-11-13 15:41:23 -0500 (Thu, 13 Nov 2008)
New Revision: 80953
Added:
projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/plugins/javaee/SecurityActions.java
Modified:
projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/plugins/javaee/EJBAuthorizationHelper.java
Log:
SECURITY-321: priv block
Modified: projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/plugins/javaee/EJBAuthorizationHelper.java
===================================================================
--- projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/plugins/javaee/EJBAuthorizationHelper.java 2008-11-13 20:39:43 UTC (rev 80952)
+++ projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/plugins/javaee/EJBAuthorizationHelper.java 2008-11-13 20:41:23 UTC (rev 80953)
@@ -165,7 +165,7 @@
EJBResource ejbResource = new EJBResource(map);
ejbResource.setPolicyContextID(contextID);
- RunAs callerRunAs = securityContext.getIncomingRunAs();
+ RunAs callerRunAs = SecurityActions.getIncomingRunAs(securityContext);
ejbResource.setEjbVersion(version);
ejbResource.setEjbName(ejbName);
Added: projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/plugins/javaee/SecurityActions.java
===================================================================
--- projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/plugins/javaee/SecurityActions.java (rev 0)
+++ projects/security/security-jboss-sx/trunk/jbosssx/src/main/java/org/jboss/security/plugins/javaee/SecurityActions.java 2008-11-13 20:41:23 UTC (rev 80953)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.security.plugins.javaee;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.jboss.security.RunAs;
+import org.jboss.security.SecurityContext;
+
+/**
+ * Privileged Blocks
+ * @author Anil.Saldhana at redhat.com
+ * @since Nov 13, 2008
+ */
+class SecurityActions
+{
+ static RunAs getIncomingRunAs(final SecurityContext sc)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<RunAs>()
+ {
+ public RunAs run()
+ {
+ return sc.getIncomingRunAs();
+ }
+ });
+ }
+}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list