diff options
Diffstat (limited to 'dozentenmodul/src/main/java')
| -rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java | 5 | ||||
| -rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java | 13 |
2 files changed, 12 insertions, 6 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java index 0b602984..32adaf24 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java @@ -251,7 +251,7 @@ public class ImageDetailsWindow extends ImageDetailsWindowLayout implements UiFe pop.addMenuItem(mnuDownload); pop.addSeparator(); pop.addMenuItem(mnuDelete); - if (Session.isSuperUser()) { + if (Session.canExtendImageExpiry()) { pop.addSeparator(); pop.addMenuItem(mnuExtendExpiryDate); } @@ -307,8 +307,7 @@ public class ImageDetailsWindow extends ImageDetailsWindowLayout implements UiFe && ImagePerms.canLink(image)); mnuDownload.setEnabled(!multiSelection && tblVersions.getSelectedItem().isValid && ImagePerms.canDownload(image)); - mnuDelete.setEnabled(tblVersions.getSelectedItem().isValid - && ImagePerms.canEdit(image)); + mnuDelete.setEnabled(ImagePerms.canEdit(image)); mnuExtendExpiryDate.setEnabled(multiSelection || tblVersions.getSelectedItem().isValid); pop.show(e.getComponent(), e.getX(), e.getY()); 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; + } + } |
