|
From: <bri...@us...> - 2008-11-05 12:04:24
|
Revision: 826
http://equanda.svn.sourceforge.net/equanda/?rev=826&view=rev
Author: brian_reynolds
Date: 2008-11-05 11:39:21 +0000 (Wed, 05 Nov 2008)
Log Message:
-----------
Added MutableAuthAndConfigProvider interface
MapAuthAndConfigProvider now implements MutableAuthAndConfigProvider
AuthAndConfigProvider.java: just some code tidy.
Modified Paths:
--------------
trunk/equanda-client/src/main/java/org/equanda/client/AuthAndConfigProvider.java
trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java
Added Paths:
-----------
trunk/equanda-server/src/main/java/org/equanda/auth/MutableAuthAndConfigProvider.java
Modified: trunk/equanda-client/src/main/java/org/equanda/client/AuthAndConfigProvider.java
===================================================================
--- trunk/equanda-client/src/main/java/org/equanda/client/AuthAndConfigProvider.java 2008-11-05 08:41:22 UTC (rev 825)
+++ trunk/equanda-client/src/main/java/org/equanda/client/AuthAndConfigProvider.java 2008-11-05 11:39:21 UTC (rev 826)
@@ -36,9 +36,9 @@
*
* @param key key to get check authorization/config data for
* @return true when there is data for the key
- */
+ */
+ boolean hasKey( String key );
- boolean hasKey( String key );
/**
* Is the data for a key readable/viewable?
*
Modified: trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java 2008-11-05 08:41:22 UTC (rev 825)
+++ trunk/equanda-server/src/main/java/org/equanda/auth/MapAuthAndConfigProvider.java 2008-11-05 11:39:21 UTC (rev 826)
@@ -35,6 +35,7 @@
*/
public class MapAuthAndConfigProvider
extends AuthAndConfigProviderAdapter
+ implements MutableAuthAndConfigProvider
{
private Map<String, AuthAndConfig> map = new HashMap<String, AuthAndConfig>();
@@ -57,4 +58,30 @@
{
return map.keySet();
}
+
+ public void setReadable( String key )
+ {
+ map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE ) );
+ }
+
+ public void setWritable( String key )
+ {
+ map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE & AuthAndConfig.AUTH_WRITABLE ) );
+ }
+
+ public void setDisplayList( String key )
+ {
+ map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE & AuthAndConfig.DISPLAY_LIST) );
+ }
+
+ public void setDisplaySummary( String key )
+ {
+ map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE & AuthAndConfig.DISPLAY_SUMMARY) );
+ }
+
+ public void setDisplayPrint( String key )
+ {
+ map.put( key, new AuthAndConfig( AuthAndConfig.AUTH_READABLE & AuthAndConfig.DISPLAY_PRINT) );
+ }
+
}
Added: trunk/equanda-server/src/main/java/org/equanda/auth/MutableAuthAndConfigProvider.java
===================================================================
--- trunk/equanda-server/src/main/java/org/equanda/auth/MutableAuthAndConfigProvider.java (rev 0)
+++ trunk/equanda-server/src/main/java/org/equanda/auth/MutableAuthAndConfigProvider.java 2008-11-05 11:39:21 UTC (rev 826)
@@ -0,0 +1,73 @@
+/**
+ * This file is part of the equanda project.
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
+ * ANY KIND, either express or implied. See the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ */
+
+package org.equanda.auth;
+
+public interface MutableAuthAndConfigProvider
+ extends org.equanda.client.AuthAndConfigProvider
+{
+
+ /**
+ * Set the key readable/viewable?
+ *
+ * @param key key to set authorization for
+ */
+ void setReadable( String key );
+
+ /**
+ * Set the key writable/editable?
+ *
+ * @param key key to set authorization for
+ */
+ void setWritable( String key );
+
+ /**
+ * Set the key to allow list
+ *
+ * @param key key to set authorization for
+ */
+ void setDisplayList( String key );
+
+ /**
+ * Set the key to allow summary
+ *
+ * @param key key to set authorization for
+ */
+ void setDisplaySummary( String key );
+
+ /**
+ * Set the key to allow print
+ *
+ * @param key key to set authorization for
+ */
+ void setDisplayPrint( String key );
+
+ /**
+ * Set the key to allow delete
+ *
+ * @param key key to set authorization for
+ *
+ void setDelete( String key );
+ */
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|