Skip to content
Snippets Groups Projects
Commit 562e0949 authored by srosse's avatar srosse
Browse files

Merge OpenOLAT 9.3 to OpenOLAT default branch with f519cac276e94f6db068e8b3a2f971ebb427d7ca

parents f639ba57 5151b226
No related branches found
No related tags found
No related merge requests found
...@@ -438,17 +438,22 @@ public class FolderRunController extends BasicController implements Activateable ...@@ -438,17 +438,22 @@ public class FolderRunController extends BasicController implements Activateable
private void enableDisableQuota(UserRequest ureq) { private void enableDisableQuota(UserRequest ureq) {
//prevent a timing condition if the user logout while a thumbnail is generated //prevent a timing condition if the user logout while a thumbnail is generated
if (ureq.getUserSession() == null || ureq.getUserSession().getRoles() == null) { if (ureq.getUserSession() == null || ureq.getUserSession().getRoles() == null) {
folderContainer.contextPut("editQuota", Boolean.FALSE);
return; return;
} else if (!ureq.getUserSession().getRoles().isOLATAdmin()) { }
if (!ureq.getUserSession().getRoles().isInstitutionalResourceManager()) {
folderContainer.contextPut("editQuota", Boolean.FALSE); Boolean newEditQuota = Boolean.FALSE;
return; if (ureq.getUserSession().getRoles().isOLATAdmin() || ureq.getUserSession().getRoles().isInstitutionalResourceManager()) {
} // Only sys admins or institutonal resource managers can have the quota button
Quota q = VFSManager.isTopLevelQuotaContainer(folderComponent.getCurrentContainer());
newEditQuota = (q == null)? Boolean.FALSE : Boolean.TRUE;
} }
Quota q = VFSManager.isTopLevelQuotaContainer(folderComponent.getCurrentContainer()); Boolean currentEditQuota = (Boolean) folderContainer.contextGet("editQuota");
folderContainer.contextPut("editQuota", (q == null)? Boolean.FALSE : Boolean.TRUE); // Update the container only if a new value is available or no value is set to
// not make the component dirty after asynchronous thumbnail loading
if (currentEditQuota == null || !currentEditQuota.equals(newEditQuota)) {
folderContainer.contextPut("editQuota", newEditQuota);
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment