use of org.olat.core.util.vfs.QuotaManager in project openolat by klemens.
the class SharedFolderSecurityCallback method initSharedFolderQuota.
/**
* Node folder quota has to be ionitialized only once for all of the paths.
*
* @param path
*/
private void initSharedFolderQuota(String path) {
QuotaManager qm = QuotaManager.getInstance();
sharedFolderQuota = qm.getCustomQuota(path);
if (sharedFolderQuota == null) {
Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_COURSE);
sharedFolderQuota = QuotaManager.getInstance().createQuota(path, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
}
}
use of org.olat.core.util.vfs.QuotaManager in project openolat by klemens.
the class CourseGroupWebService method getFolder.
@Path("{groupKey}/folder")
public VFSWebservice getFolder(@PathParam("groupKey") Long groupKey, @Context HttpServletRequest request) {
BusinessGroupService bgs = CoreSpringFactory.getImpl(BusinessGroupService.class);
BusinessGroup bg = bgs.loadBusinessGroup(groupKey);
if (bg == null) {
return null;
}
if (!isGroupManager(request)) {
Identity identity = RestSecurityHelper.getIdentity(request);
if (!bgs.isIdentityInBusinessGroup(identity, bg)) {
return null;
}
}
CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(bg);
if (!collabTools.isToolEnabled(CollaborationTools.TOOL_FOLDER)) {
return null;
}
String relPath = collabTools.getFolderRelPath();
QuotaManager qm = QuotaManager.getInstance();
Quota folderQuota = qm.getCustomQuota(relPath);
if (folderQuota == null) {
Quota defQuota = qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_GROUPS);
folderQuota = QuotaManager.getInstance().createQuota(relPath, defQuota.getQuotaKB(), defQuota.getUlLimitKB());
}
SubscriptionContext subsContext = null;
VFSWebServiceSecurityCallback secCallback = new VFSWebServiceSecurityCallback(true, true, true, folderQuota, subsContext);
OlatRootFolderImpl rootContainer = new OlatRootFolderImpl(relPath, null);
rootContainer.setLocalSecurityCallback(secCallback);
return new VFSWebservice(rootContainer);
}
use of org.olat.core.util.vfs.QuotaManager in project openolat by klemens.
the class QuotaTableModel method refresh.
/**
*/
public void refresh() {
QuotaManager qm = QuotaManager.getInstance();
quotaList = qm.listCustomQuotasKB();
}
use of org.olat.core.util.vfs.QuotaManager in project openolat by klemens.
the class GenericQuotaEditController method initMyContent.
private void initMyContent(UserRequest ureq) {
QuotaManager qm = QuotaManager.getInstance();
if (!qm.hasQuotaEditRights(ureq.getIdentity())) {
throw new OLATSecurityException("Insufficient permissions to access QuotaController");
}
myContent = createVelocityContainer("edit");
LinkFactory.createButtonSmall("qf.new", myContent, this);
delQuotaButton = LinkFactory.createButtonSmall("qf.del", myContent, this);
myContent.contextPut("users", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_USERS));
myContent.contextPut("powerusers", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER));
myContent.contextPut("groups", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_GROUPS));
myContent.contextPut("repository", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_REPO));
myContent.contextPut("coursefolder", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_COURSE));
myContent.contextPut("nodefolder", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES));
myContent.contextPut("feeds", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_FEEDS));
}
use of org.olat.core.util.vfs.QuotaManager in project openolat by klemens.
the class GenericQuotaViewController method initMyContent.
private void initMyContent() {
QuotaManager qm = QuotaManager.getInstance();
myContent = createVelocityContainer("edit");
myContent.contextPut("notEnoughPrivilege", Boolean.FALSE);
myContent.contextPut("users", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_USERS));
myContent.contextPut("powerusers", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER));
myContent.contextPut("groups", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_GROUPS));
myContent.contextPut("repository", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_REPO));
myContent.contextPut("coursefolder", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_COURSE));
myContent.contextPut("nodefolder", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_NODES));
myContent.contextPut("feeds", qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_FEEDS));
}
Aggregations