diff options
| author | Kuersat Akmaz | 2020-07-07 23:54:11 +0200 |
|---|---|---|
| committer | Kuersat Akmaz | 2020-07-07 23:55:28 +0200 |
| commit | 1686ec11b4f16613ebf07bbb3599122811d0e24d (patch) | |
| tree | b7f3fc7b821195ab47ff98aa87233b779414f1d0 /dozentenmodul/src/main/java | |
| parent | [client] Diabled cboFilter for Students in LectureList (diff) | |
| download | tutor-module-1686ec11b4f16613ebf07bbb3599122811d0e24d.tar.gz tutor-module-1686ec11b4f16613ebf07bbb3599122811d0e24d.tar.xz tutor-module-1686ec11b4f16613ebf07bbb3599122811d0e24d.zip | |
[client] Session.isStudent definition and all ocurences Removed
Session.canListImages fullwills the same purpose
so no redundance needed.
Issue : #3727
Diffstat (limited to 'dozentenmodul/src/main/java')
3 files changed, 5 insertions, 12 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java index 319499f1..e739813f 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java @@ -278,12 +278,13 @@ public class ImageListWindow extends ImageListWindowLayout implements DownloadCa popupItemDelete.setEnabled(delete); btnEditDetails.setEnabled(selCount == 1); - if (Session.isStudent()) + if (!Session.canListImages()) { deactiveUnnecessaryButtonsForStudents(); } else { btnShowPublishedImages.setEnabled(true); } + } public void refresh(boolean force) { @@ -446,7 +447,7 @@ public class ImageListWindow extends ImageListWindowLayout implements DownloadCa // we need to enable the "Show published images" button here, since we need to check // Session.getSatApiVersion() which is not set when this class is instantiated ctlImageListViewer.refreshList(false, 1); - if(Session.isStudent()) + if(!Session.canListImages()) { btnShowPublishedImages.setVisible(false); } else { diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java index a3bc0d6b..d6adfc5e 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java @@ -473,7 +473,7 @@ public class LectureListWindow extends LectureListWindowLayout { updateAvailableOptions(null); refreshList(false); - if (Session.isStudent()) + if (!Session.canListImages()) { deactiveUnnecessaryButtonsForStudents(); } 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 8934620f..46771d46 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java @@ -83,15 +83,7 @@ public class Session { return null; return data.user.userId; } - /** - * @return checks if user is Student - */ - public static boolean isStudent() { - if (data == null) - return false; - return data.user.role == Role.STUDENT; - } - + /** * @return the organization id */ |
