summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/util
diff options
context:
space:
mode:
authorMichael Wilson2014-10-09 16:59:16 +0200
committerMichael Wilson2014-10-09 16:59:16 +0200
commit2e740d7e3143da8844b16e0976e2b031758ef52a (patch)
tree6c6930cb2cd44dee95ce8eaec9066c64d2572069 /dozentenmodul/src/main/java/util
parentMerge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module (diff)
downloadtutor-module-2e740d7e3143da8844b16e0976e2b031758ef52a.tar.gz
tutor-module-2e740d7e3143da8844b16e0976e2b031758ef52a.tar.xz
tutor-module-2e740d7e3143da8844b16e0976e2b031758ef52a.zip
vorbereitung rechte korrigieren
Diffstat (limited to 'dozentenmodul/src/main/java/util')
-rw-r--r--dozentenmodul/src/main/java/util/CheckIntegrity.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/dozentenmodul/src/main/java/util/CheckIntegrity.java b/dozentenmodul/src/main/java/util/CheckIntegrity.java
new file mode 100644
index 00000000..d87a8579
--- /dev/null
+++ b/dozentenmodul/src/main/java/util/CheckIntegrity.java
@@ -0,0 +1,47 @@
+package util;
+
+public class CheckIntegrity {
+
+ private static boolean isFine = false;
+
+ // integrety check on permissions put by user
+ public static boolean[] isIntegre(boolean isRead, boolean isWrite,
+ boolean isLink, boolean isAdmin) {
+ // boolean array for the correct result values
+ boolean[] rights = new boolean[4];
+ rights[0] = isRead;
+ rights[1] = isWrite;
+ rights[2] = isLink;
+ rights[3] = isAdmin;
+
+ // do all checks and only change wrong settings
+ if (isAdmin == true) {
+ // set true for everything
+ rights[0] = true;
+ rights[1] = true;
+ rights[2] = true;
+ rights[3] = true;
+ return rights;
+ } else {
+ if(isRead == false){
+ //if user may not read, then he may not do anything
+ rights[0] = false;
+ rights[1] = false;
+ rights[2] = false;
+ rights[3] = false;
+ }
+ if (isWrite == true) {
+ // if user can write, then he must also be allowed to read
+ rights[0] = true;
+ }
+
+ if (isLink == true) {
+ // if user may link, then he may also read
+
+ }
+ }
+
+ return rights;
+ }
+
+}