use of org.olat.modules.taxonomy.TaxonomyRef in project OpenOLAT by OpenOLAT.
the class DocumentPoolSiteSecurityCallback method isAllowedToLaunchSite.
/**
* @see com.frentix.olat.coursesite.SiteSecurityCallback#isAllowedToLaunchSite(org.olat.core.gui.UserRequest)
*/
@Override
public boolean isAllowedToLaunchSite(UserRequest ureq) {
UserSession usess = ureq == null ? null : ureq.getUserSession();
if (usess == null)
return false;
Roles roles = usess.getRoles();
if (roles == null || roles.isInvitee() || roles.isGuestOnly()) {
return false;
}
if (roles.isOLATAdmin()) {
return true;
}
String taxonomyKey = docPoolModule.getTaxonomyTreeKey();
if (StringHelper.isLong(taxonomyKey)) {
TaxonomyRef taxonomy = new TaxonomyRefImpl(new Long(taxonomyKey));
return taxonomyService.hasTaxonomyCompetences(taxonomy, ureq.getIdentity(), ureq.getRequestTimestamp());
}
return false;
}
use of org.olat.modules.taxonomy.TaxonomyRef in project openolat by klemens.
the class DocumentPoolSiteSecurityCallback method isAllowedToLaunchSite.
/**
* @see com.frentix.olat.coursesite.SiteSecurityCallback#isAllowedToLaunchSite(org.olat.core.gui.UserRequest)
*/
@Override
public boolean isAllowedToLaunchSite(UserRequest ureq) {
UserSession usess = ureq == null ? null : ureq.getUserSession();
if (usess == null)
return false;
Roles roles = usess.getRoles();
if (roles == null || roles.isInvitee() || roles.isGuestOnly()) {
return false;
}
if (roles.isOLATAdmin()) {
return true;
}
String taxonomyKey = docPoolModule.getTaxonomyTreeKey();
if (StringHelper.isLong(taxonomyKey)) {
TaxonomyRef taxonomy = new TaxonomyRefImpl(new Long(taxonomyKey));
return taxonomyService.hasTaxonomyCompetences(taxonomy, ureq.getIdentity(), ureq.getRequestTimestamp());
}
return false;
}
use of org.olat.modules.taxonomy.TaxonomyRef in project OpenOLAT by OpenOLAT.
the class PoolTaxonomySecurityCallback method isAllowedToLaunchSite.
@Override
public boolean isAllowedToLaunchSite(UserRequest ureq) {
if (!questionPoolModule.isEnabled() || !StringHelper.isLong(questionPoolModule.getTaxonomyQPoolKey()) || ureq == null || ureq.getIdentity() == null) {
return false;
}
UserSession usess = ureq.getUserSession();
if (usess == null) {
return false;
}
Roles roles = usess.getRoles();
if (roles == null || roles.isInvitee() || roles.isGuestOnly()) {
return false;
}
if (roles.isOLATAdmin() || roles.isPoolAdmin()) {
return true;
}
TaxonomyCompetenceTypes[] types = new TaxonomyCompetenceTypes[] { TaxonomyCompetenceTypes.manage, TaxonomyCompetenceTypes.teach };
TaxonomyRef taxonomy = new TaxonomyRefImpl(Long.valueOf(questionPoolModule.getTaxonomyQPoolKey()));
return taxonomyService.hasTaxonomyCompetences(taxonomy, ureq.getIdentity(), new Date(), types);
}
use of org.olat.modules.taxonomy.TaxonomyRef in project openolat by klemens.
the class PoolTaxonomySecurityCallback method isAllowedToLaunchSite.
@Override
public boolean isAllowedToLaunchSite(UserRequest ureq) {
if (!questionPoolModule.isEnabled() || !StringHelper.isLong(questionPoolModule.getTaxonomyQPoolKey()) || ureq == null || ureq.getIdentity() == null) {
return false;
}
UserSession usess = ureq.getUserSession();
if (usess == null) {
return false;
}
Roles roles = usess.getRoles();
if (roles == null || roles.isInvitee() || roles.isGuestOnly()) {
return false;
}
if (roles.isOLATAdmin() || roles.isPoolAdmin()) {
return true;
}
TaxonomyCompetenceTypes[] types = new TaxonomyCompetenceTypes[] { TaxonomyCompetenceTypes.manage, TaxonomyCompetenceTypes.teach };
TaxonomyRef taxonomy = new TaxonomyRefImpl(Long.valueOf(questionPoolModule.getTaxonomyQPoolKey()));
return taxonomyService.hasTaxonomyCompetences(taxonomy, ureq.getIdentity(), new Date(), types);
}
Aggregations