Skip to content

Commit

Permalink
LSNBLDR-633: Restrict editing of Lessons pages and subpages to one pe…
Browse files Browse the repository at this point in the history
…rson (sakaiproject#4347)

LSNBLDR-633: Restrict editing of Lessons pages and subpages to one person

LSNBLDR-633: indentation
  • Loading branch information
nicholaswilson100 authored and buckett committed Jun 29, 2017
1 parent 8d2d157 commit 7a1b1d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,11 @@ public String getPageUrl(long pageId) {
}

public List<SimplePage> getSitePages(String siteId) {
DetachedCriteria d = DetachedCriteria.forClass(SimplePage.class).add(Restrictions.eq("siteId", siteId)).add(Restrictions.isNull("owner"));
DetachedCriteria d = DetachedCriteria.forClass(SimplePage.class).add(Restrictions.eq("siteId", siteId))
.add(Restrictions.disjunction()
.add(Restrictions.isNull("owner"))
.add(Restrictions.eq("owned", true))
);

List<SimplePage> l = (List<SimplePage>) getHibernateTemplate().findByCriteria(d);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7045,7 +7045,7 @@ public void addStudentContentSection() {
if (!checkCsrf())
return;

if(getCurrentPage().getOwner() == null) {
if(canEditPage()) {
SimplePageItem item = appendItem("", messageLocator.getMessage("simplepage.student-content"), SimplePageItem.STUDENT_CONTENT);
item.setDescription(messageLocator.getMessage("simplepage.student-content"));
saveItem(item);
Expand Down

0 comments on commit 7a1b1d1

Please sign in to comment.