james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [4/6] james-project git commit: JAMES-2043 UsersRepository should indicate if it is read-only
Date Tue, 06 Jun 2017 08:28:53 GMT
JAMES-2043 UsersRepository should indicate if it is read-only


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/8e9d7bea
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/8e9d7bea
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/8e9d7bea

Branch: refs/heads/master
Commit: 8e9d7beaf19aceec2464795df0d11ad722d34dbe
Parents: dea0525
Author: benwa <btellier@linagora.com>
Authored: Fri Jun 2 11:50:49 2017 +0700
Committer: benwa <btellier@linagora.com>
Committed: Tue Jun 6 15:27:57 2017 +0700

----------------------------------------------------------------------
 .../main/java/org/apache/james/user/api/UsersRepository.java   | 6 ++++++
 .../apache/james/user/ldap/ReadOnlyUsersLDAPRepository.java    | 5 +++++
 .../org/apache/james/user/lib/AbstractUsersRepository.java     | 5 +++++
 3 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/8e9d7bea/server/data/data-api/src/main/java/org/apache/james/user/api/UsersRepository.java
----------------------------------------------------------------------
diff --git a/server/data/data-api/src/main/java/org/apache/james/user/api/UsersRepository.java
b/server/data/data-api/src/main/java/org/apache/james/user/api/UsersRepository.java
index ea02cc3..038fd30 100644
--- a/server/data/data-api/src/main/java/org/apache/james/user/api/UsersRepository.java
+++ b/server/data/data-api/src/main/java/org/apache/james/user/api/UsersRepository.java
@@ -142,4 +142,10 @@ public interface UsersRepository {
      */
     boolean isAdministrator(String username) throws UsersRepositoryException;
 
+    /**
+     * @return true if one can use {@link UsersRepository#updateUser(User)} {@link UsersRepository#addUser(String,
String)}
+     *             {@link UsersRepository#removeUser(String)} and false overwhise
+     */
+    boolean isReadOnly();
+
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/8e9d7bea/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/ReadOnlyUsersLDAPRepository.java
----------------------------------------------------------------------
diff --git a/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/ReadOnlyUsersLDAPRepository.java
b/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/ReadOnlyUsersLDAPRepository.java
index e91ede4..e2007cb 100644
--- a/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/ReadOnlyUsersLDAPRepository.java
+++ b/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/ReadOnlyUsersLDAPRepository.java
@@ -818,4 +818,9 @@ public class ReadOnlyUsersLDAPRepository implements UsersRepository, Configurabl
         }
         return false;
     }
+
+    @Override
+    public boolean isReadOnly() {
+        return true;
+    }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/8e9d7bea/server/data/data-library/src/main/java/org/apache/james/user/lib/AbstractUsersRepository.java
----------------------------------------------------------------------
diff --git a/server/data/data-library/src/main/java/org/apache/james/user/lib/AbstractUsersRepository.java
b/server/data/data-library/src/main/java/org/apache/james/user/lib/AbstractUsersRepository.java
index f0651fe..bd9a9d2 100644
--- a/server/data/data-library/src/main/java/org/apache/james/user/lib/AbstractUsersRepository.java
+++ b/server/data/data-library/src/main/java/org/apache/james/user/lib/AbstractUsersRepository.java
@@ -159,4 +159,9 @@ public abstract class AbstractUsersRepository implements UsersRepository,
LogEna
         }
         return false;
     }
+
+    @Override
+    public boolean isReadOnly() {
+        return false;
+    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message