You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2009/09/13 19:55:08 UTC

svn commit: r814366 - /incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/Role.java

Author: ajaquith
Date: Sun Sep 13 17:55:08 2009
New Revision: 814366

URL: http://svn.apache.org/viewvc?rev=814366&view=rev
Log:
The "superuser" (su) feature has been implemented. This user can do anything, and can log in even when the UserManager is not working. The password is hashed and stored in jspwiki.properties.

Modified:
    incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/Role.java

Modified: incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/Role.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/Role.java?rev=814366&r1=814365&r2=814366&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/Role.java (original)
+++ incubator/jspwiki/trunk/src/java/org/apache/wiki/auth/authorize/Role.java Sun Sep 13 17:55:08 2009
@@ -46,6 +46,12 @@
     /** If the user has authenticated with the Container or UserDatabase */
     public static final Role AUTHENTICATED = new Role( "Authenticated" );
 
+    /**
+     * If the user is the superuser.
+     * @since 3.0
+     */
+    public static final Role SUPERUSER = new Role( "SU" );
+
     private final String   m_name;
 
     /**
@@ -83,7 +89,7 @@
      * Returns <code>true</code> if the supplied name is identical to the name
      * of a built-in Role; that is, the value returned by <code>getName()</code>
      * for built-in Roles {@link #ALL}, {@link #ANONYMOUS},
-     * {@link #ASSERTED}, or {@link #AUTHENTICATED}.
+     * {@link #ASSERTED}, {@link #AUTHENTICATED} or {@link #SUPERUSER}.
      * @param name the name to be tested
      * @return <code>true</code> if the name is reserved; <code>false</code>
      *         if not
@@ -92,7 +98,7 @@
     {
         return  name.equals( ALL.m_name ) ||
                 name.equals( ANONYMOUS.m_name ) || name.equals( ASSERTED.m_name ) ||
-                name.equals( AUTHENTICATED.m_name );
+                name.equals( AUTHENTICATED.m_name ) || name.equals( SUPERUSER );
     }
 
     /**