[jboss-cvs] JBossAS SVN: r96751 - in projects/security/security-jboss-sx/branches/Branch_2_0: jbosssx/src/main/java/org/jboss/security/plugins and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Nov 23 14:11:00 EST 2009
Author: sguilhen at redhat.com
Date: 2009-11-23 14:11:00 -0500 (Mon, 23 Nov 2009)
New Revision: 96751
Modified:
projects/security/security-jboss-sx/branches/Branch_2_0/.classpath
projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/security/plugins/JBossSecurityContext.java
projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/test/java/org/jboss/test/securitycontext/TestSecurityContext.java
Log:
SECURITY-443: added setSecurityDomain() to JBossSecurityContext
Modified: projects/security/security-jboss-sx/branches/Branch_2_0/.classpath
===================================================================
--- projects/security/security-jboss-sx/branches/Branch_2_0/.classpath 2009-11-23 19:10:14 UTC (rev 96750)
+++ projects/security/security-jboss-sx/branches/Branch_2_0/.classpath 2009-11-23 19:11:00 UTC (rev 96751)
@@ -29,18 +29,14 @@
<classpathentry kind="var" path="M2_REPO/javassist/javassist/3.4.GA/javassist-3.4.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/javaee/jboss-javaee/5.0.1.GA/jboss-javaee-5.0.1.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/jboss/jboss-jmx/4.2.1.GA/jboss-jmx-4.2.1.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3/jbossxacml-2.0.3.jar"/>
<classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/jboss-test/1.0.4.GA/jboss-test-1.0.4.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/security/jboss-security-spi/2.0.2-SNAPSHOT/jboss-security-spi-2.0.2-SNAPSHOT.jar" sourcepath="/M2_REPO/org/jboss/security/jboss-security-spi/2.0.2-SNAPSHOT/jboss-security-spi-2.0.2-SNAPSHOT-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/hsqldb/hsqldb/1.8.0.2/hsqldb-1.8.0.2.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/mail/mail/1.4/mail-1.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/jnpserver/5.0.0.Beta3/jnpserver-5.0.0.Beta3.jar"/>
<classpathentry kind="var" path="M2_REPO/sleepycat/je/3.2.43/je-3.2.43.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-kernel/2.0.6.GA/jboss-kernel-2.0.6.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/jboss-reflect/2.0.2.GA/jboss-reflect-2.0.2.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/man/jboss-managed/2.0.0.GA/jboss-managed-2.0.0.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/sun-opends/OpenDS/1.0.0/OpenDS-1.0.0.jar"/>
<classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar"/>
<classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar"/>
@@ -49,5 +45,7 @@
<classpathentry kind="var" path="M2_REPO/org/jboss/microcontainer/jboss-dependency/2.0.6.GA/jboss-dependency-2.0.6.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/metadata/jboss-metadata/1.0.1.GA/jboss-metadata-1.0.1.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/jboss-mdr/2.0.1.GA/jboss-mdr-2.0.1.GA.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-xacml"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/security-spi-b20"/>
<classpathentry kind="output" path="target-eclipse/eclipse-classes"/>
</classpath>
Modified: projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/security/plugins/JBossSecurityContext.java
===================================================================
--- projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/security/plugins/JBossSecurityContext.java 2009-11-23 19:10:14 UTC (rev 96750)
+++ projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/main/java/org/jboss/security/plugins/JBossSecurityContext.java 2009-11-23 19:11:00 UTC (rev 96751)
@@ -65,6 +65,9 @@
private static final RuntimePermission setSecurityManagementPermission
= new RuntimePermission(JBossSecurityContext.class.getName() + ".setSecurityManagement");
+ private static final RuntimePermission setSecurityDomainPermission
+ = new RuntimePermission(JBossSecurityContext.class.getName() + ".setSecurityDomain");
+
protected static final Logger log = Logger.getLogger(JBossSecurityContext.class);
protected boolean trace = log.isTraceEnabled();
@@ -149,8 +152,22 @@
{
return securityDomain;
}
-
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.security.SecurityContext#setSecurityDomain(java.lang.String)
+ */
+ public void setSecurityDomain(String domain)
+ {
+ SecurityManager manager = System.getSecurityManager();
+ if(manager != null)
+ manager.checkPermission(setSecurityDomainPermission);
+
+ if (domain == null)
+ throw new IllegalArgumentException("Security domain cannot be null");
+ this.securityDomain = domain;
+ }
+
/**
* @see SecurityContext#getSubjectInfo()
*
Modified: projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/test/java/org/jboss/test/securitycontext/TestSecurityContext.java
===================================================================
--- projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/test/java/org/jboss/test/securitycontext/TestSecurityContext.java 2009-11-23 19:10:14 UTC (rev 96750)
+++ projects/security/security-jboss-sx/branches/Branch_2_0/jbosssx/src/test/java/org/jboss/test/securitycontext/TestSecurityContext.java 2009-11-23 19:11:00 UTC (rev 96751)
@@ -69,6 +69,10 @@
{
return null;
}
+
+ public void setSecurityDomain(String domain)
+ {
+ }
public SubjectInfo getSubjectInfo()
{
More information about the jboss-cvs-commits
mailing list