Skip to content

Commit

Permalink
SAK-31958 ResourceProperties: term, term_eid (sakaiproject#3609)
Browse files Browse the repository at this point in the history
  • Loading branch information
axxter99 authored and ottenhoff committed Nov 21, 2016
1 parent 0352050 commit 7cc6496
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions delegatedaccess/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${joda.time.version}</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.joda.time.DateTime;
import org.quartz.JobExecutionException;
import org.sakaiproject.authz.api.AuthzGroup;
import org.sakaiproject.authz.api.AuthzGroupService;
Expand Down Expand Up @@ -77,6 +78,9 @@ public SecurityAdvice isAllowed(String userId, String function, String reference
loginToSakai();
securityService.pushAdvisor(yesMan);
AuthzGroup templateGroup = authzGroupService.getAuthzGroup("!site.template.course");

DateTime date = new DateTime();
String term = "Spring " + date.getYear();
for(String school : schools){
for(String dept : depts){
for(String subject : subjs){
Expand Down Expand Up @@ -164,6 +168,9 @@ public SecurityAdvice isAllowed(String userId, String function, String reference
propEdit.addProperty("Department", dept);
propEdit.addProperty("Subject", subject);

propEdit.addProperty("term", term);
propEdit.addProperty("term_eid", term);

siteService.save(siteEdit);

//Make sure roles exist:
Expand Down

0 comments on commit 7cc6496

Please sign in to comment.