jmcnally 2002/06/22 09:26:32
Modified: src/java/org/apache/fulcrum/security TurbineSecurity.java
Log:
patch by Stephen Haberman <[EMAIL PROTECTED]>
The TurbineSecurity has createGroup/createPermission convenience
methods, however it doesn't follow up and also have a createRole
convenience method.
The attached patch adds the simple, but handy, createRole convenience
method in the same style of the createGroup/createPermission methods.
Revision Changes Path
1.2 +15 -1
jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/TurbineSecurity.java
Index: TurbineSecurity.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/security/TurbineSecurity.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TurbineSecurity.java 30 May 2002 02:27:30 -0000 1.1
+++ TurbineSecurity.java 22 Jun 2002 16:26:32 -0000 1.2
@@ -487,6 +487,20 @@
}
/**
+ * Creates a new Role in the system. This is a convenience
+ * method.
+ *
+ * @param name The name of the Role.
+ * @return An object representing the new Role.
+ * @throws TurbineSecurityException if the Role could not be created.
+ */
+ public static Role createRole( String name )
+ throws TurbineSecurityException
+ {
+ return getService().addRole(getNewRole(name));
+ }
+
+ /**
* Retrieves a named Group.
*
* @param groupName The name of the Group to be retrieved.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>