Add option to require full access for Sone.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 7 May 2011 00:12:26 +0000 (02:12 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 7 May 2011 00:12:26 +0000 (02:12 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java

index 238d9d5..0685c9a 100644 (file)
@@ -1701,6 +1701,7 @@ public class Core implements IdentityListener, UpdateListener {
                        configuration.getIntValue("Option/ConfigurationVersion").setValue(0);
                        configuration.getIntValue("Option/InsertionDelay").setValue(options.getIntegerOption("InsertionDelay").getReal());
                        configuration.getIntValue("Option/PostsPerPage").setValue(options.getIntegerOption("PostsPerPage").getReal());
+                       configuration.getBooleanValue("Option/RequireFullAccess").setValue(options.getBooleanOption("RequireFullAccess").getReal());
                        configuration.getIntValue("Option/PositiveTrust").setValue(options.getIntegerOption("PositiveTrust").getReal());
                        configuration.getIntValue("Option/NegativeTrust").setValue(options.getIntegerOption("NegativeTrust").getReal());
                        configuration.getStringValue("Option/TrustComment").setValue(options.getStringOption("TrustComment").getReal());
@@ -1775,6 +1776,7 @@ public class Core implements IdentityListener, UpdateListener {
 
                }));
                options.addIntegerOption("PostsPerPage", new DefaultOption<Integer>(10));
+               options.addBooleanOption("RequireFullAccess", new DefaultOption<Boolean>(false));
                options.addIntegerOption("PositiveTrust", new DefaultOption<Integer>(75));
                options.addIntegerOption("NegativeTrust", new DefaultOption<Integer>(-25));
                options.addStringOption("TrustComment", new DefaultOption<String>("Set from Sone Web Interface"));
@@ -1795,6 +1797,7 @@ public class Core implements IdentityListener, UpdateListener {
 
                options.getIntegerOption("InsertionDelay").set(configuration.getIntValue("Option/InsertionDelay").getValue(null));
                options.getIntegerOption("PostsPerPage").set(configuration.getIntValue("Option/PostsPerPage").getValue(null));
+               options.getBooleanOption("RequireFullAccess").set(configuration.getBooleanValue("Option/RequireFullAccess").getValue(null));
                options.getIntegerOption("PositiveTrust").set(configuration.getIntValue("Option/PositiveTrust").getValue(null));
                options.getIntegerOption("NegativeTrust").set(configuration.getIntValue("Option/NegativeTrust").getValue(null));
                options.getStringOption("TrustComment").set(configuration.getStringValue("Option/TrustComment").getValue(null));
@@ -2048,6 +2051,27 @@ public class Core implements IdentityListener, UpdateListener {
                }
 
                /**
+                * Returns whether Sone requires full access to be even visible.
+                *
+                * @return {@code true} if Sone requires full access, {@code false}
+                *         otherwise
+                */
+               public boolean isRequireFullAccess() {
+                       return options.getBooleanOption("RequireFullAccess").get();
+               }
+
+               /**
+                * Sets whether Sone requires full access to be even visible.
+                *
+                * @param requireFullAccess
+                *            {@code true} if Sone requires full access, {@code false}
+                *            otherwise
+                */
+               public void setRequireFullAccess(Boolean requireFullAccess) {
+                       options.getBooleanOption("RequireFullAccess").set(requireFullAccess);
+               }
+
+               /**
                 * Returns the positive trust.
                 *
                 * @return The positive trust