Skip to content

Commit

Permalink
LSNBLDR-633: Restrict editing Lessons pages/subpages to one or more p…
Browse files Browse the repository at this point in the history
…eople (#3747)

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

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

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

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

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

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

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

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

LSNBLDR-633: Tweaks
  • Loading branch information
nicholaswilson100 authored and jonespm committed Mar 14, 2017
1 parent 2531561 commit 3c127f8
Show file tree
Hide file tree
Showing 23 changed files with 251 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,8 @@ public interface SimplePage {

public String getFolder();

public boolean isOwned();

public void setOwned(Boolean isOwned);

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<property name="group" type="string" column="groupid" length="99" />
<property name="cssSheet" type="string" length="250" />
<property name="folder" type="string" length="250" />
<property name="owned" type="boolean" />

</class>
</hibernate-mapping>
1 change: 1 addition & 0 deletions lessonbuilder/hbm/src/ddl/derby/lessonbuilder.sql
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
gradebookPoints double,
owner varchar(36),
groupOwned smallint,
owned smallint,
groupid varchar(36),
cssSheet varchar(250),
primary key (pageId)
Expand Down
1 change: 1 addition & 0 deletions lessonbuilder/hbm/src/ddl/hsqldb/lessonbuilder.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
gradebookPoints double,
owner varchar(99),
groupOwned bit,
owned bit,
groupid varchar(99),
cssSheet varchar(250),
primary key (pageId)
Expand Down
1 change: 1 addition & 0 deletions lessonbuilder/hbm/src/ddl/mssql/lessonbuilder.sql
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
gradebookPoints double precision null,
owner varchar(36) null,
groupOwned tinyint null,
owned tinyint not null,
groupid varchar(36) null,
cssSheet varchar(250) null,
primary key (pageId)
Expand Down
1 change: 1 addition & 0 deletions lessonbuilder/hbm/src/ddl/mysql/lessonbuilder.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
gradebookPoints double precision,
owner varchar(99),
groupOwned bit,
owned bit,
groupid varchar(99),
cssSheet varchar(250),
primary key (pageId)
Expand Down
1 change: 1 addition & 0 deletions lessonbuilder/hbm/src/ddl/oracle/lessonbuilder.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
gradebookPoints double precision,
owner varchar2(99 char),
groupOwned number(1,0),
owned number(1,0),
groupid varchar2(99 char),
cssSheet varchar2(250 char),
primary key (pageId)
Expand Down
1 change: 1 addition & 0 deletions lessonbuilder/hbm/src/ddl/postgres/lessonbuilder.sql
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
gradebookPoints float8,
owner varchar(36),
groupOwned bool,
owned bool,
groupid varchar(36),
cssSheet varchar(250),
primary key (pageId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public class SimplePageImpl implements SimplePage {

private String folder = null; // ID of a resource

private boolean owned = false;

public SimplePageImpl() {}

public SimplePageImpl(String toolId, String siteId, String title, Long parent, Long topParent) {
Expand Down Expand Up @@ -179,4 +181,14 @@ public void setFolder(String f) {
this.folder = f;
}

public boolean isOwned() {
return owned;
}

public void setOwned(Boolean owned) {
if(owned == null) {
owned = false;
}
this.owned = owned;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ Set<Path> getPagePaths(long pageId, Set<Long>seen, boolean usePrerequisites) {

// if it's a student page, have to handle specially. Find item that has the student content section
// if usePrerequistes false, this can't happen, since no graded items will occur there
if (page.getOwner() != null) {
if (page.getOwner() != null && !page.isOwned()) {
SimpleStudentPage student = dao.findStudentPage(page.getTopParent());
SimplePageItem item = dao.findItem(student.getItemId());
items = new ArrayList<SimplePageItem>();
Expand Down

0 comments on commit 3c127f8

Please sign in to comment.