diff options
author | Simon Rettberg | 2016-08-17 16:25:57 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-08-17 16:25:57 +0200 |
commit | e82d9b24ef0e08f7f4e1cde79e7e30f539a4d0b3 (patch) | |
tree | fec80480988dd9e7bbd7e1081a9413b907a70e03 /dozentenmodul/src/main/java/org/openslx/dozmod/thrift | |
parent | [client] fix bad condition (diff) | |
download | tutor-module-e82d9b24ef0e08f7f4e1cde79e7e30f539a4d0b3.tar.gz tutor-module-e82d9b24ef0e08f7f4e1cde79e7e30f539a4d0b3.tar.xz tutor-module-e82d9b24ef0e08f7f4e1cde79e7e30f539a4d0b3.zip |
[client] Allow deletion of expired image versions
The menu entry was grayed out for expired versions, making it impossible
to delete such versions.
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/thrift')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java index a2677638..6eb91fe7 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java @@ -24,7 +24,8 @@ public class Session { private static SatelliteConfig satConf = null; - public static void initialize(WhoamiInfo whoami, String satAddress, String satToken, String masToken, long satApiVersion) { + public static void initialize(WhoamiInfo whoami, String satAddress, String satToken, String masToken, + long satApiVersion) { if (whoami == null || whoami.user == null || whoami.user.userId == null) { throw new IllegalArgumentException( "Cannot initialize session: whoami-Information from satellite incomplete"); @@ -134,14 +135,16 @@ public class Session { } /** - * @return true if the satellite's API version supports publications of images (version 3 and above), false otherwise + * @return true if the satellite's API version supports publications of + * images (version 3 and above), false otherwise */ public static boolean isImagePublishSupported() { return satelliteApiVersion >= 3; } /** - * @return true if the satellite's API version supports netrules, internet blocking, exam mode (version 4 and above), false otherwise + * @return true if the satellite's API version supports netrules, internet + * blocking, exam mode (version 4 and above), false otherwise */ public static boolean isNetrulesSupported() { return satelliteApiVersion >= 4; @@ -172,4 +175,8 @@ public class Session { } } + public static boolean canExtendImageExpiry() { + return isSuperUser() && satelliteApiVersion >= 3; + } + } |