Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
zacci authored Apr 12, 2018
2 parents 606d3bd + d55cb2d commit 75ad24f
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 33 deletions.
52 changes: 26 additions & 26 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This app will not work with earlier versions of Java 8.
+
. Download the latest `prisonbook.jar` link:{repoURL}/releases[here].
. Copy the file to the folder you want to use as the home folder for your PrisonBook.
. Double-click the file to start the app. The GUI should appear in a few seconds.
. Double-click the file to start the app. The GUI should appear in a few seconds. Do NOT use command prompt to open the app.
+
image::Ui.png[width="790"]
+
Expand Down Expand Up @@ -382,43 +382,43 @@ _{explain how the user can enable/disable data encryption}_
== Command Summary

* Security Level 0: +
*Check status* : `status` +
*Exit* : `exit` +
*Help* : `help` +
*History* : `history` or `h` +
*Log in* : `login` +
*Log out* : `logout` +
*Undo* : `undo` or `u` +
*Redo* : `redo` or `r`
** *Check status* : `status` +
** *Exit* : `exit` +
** *Help* : `help` +
** *History* : `history` or `h` +
** *Log in* : `login` +
** *Log out* : `logout` +
** *Undo* : `undo` or `u` +
** *Redo* : `redo` or `r`

* Security Level 1: +
*Calendar* : `calendar` or `cal` +
*Delete user* : `deleteuser user/NEW_USERNAME` +
e.g. `deleteuser user/prisonguard` +
*Find* : `find n/NAME_KEYWORD [MORE_KEYWORDS] t/TAG_KEYWORD [MORE_KEYWORDS]` +
** *Calendar* : `calendar` or `cal` +
** *Find* : `find n/NAME_KEYWORD [MORE_KEYWORDS] t/TAG_KEYWORD [MORE_KEYWORDS]` +
e.g. `find n/Meier` +
*List* : `list` or `l` +
*List prisoners in a cell* : `listcell CELL` +
** *List* : `list` or `l` +
** *List prisoners in a cell* : `listcell CELL` +
e.g. `listcell 1-1` +
*Map* : `map` or `m`
** *Map* : `map` or `m`

* Security Level 2: +
*Add* : `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS r/ROLE [t/TAG]...` +
** *Add* : `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS r/ROLE [t/TAG]...` +
e.g. `add n/James Ho p/22224444 e/[email protected] a/123, Clementi Rd, 1234665 r/p t/friend t/colleague` +
*Add prisoner to cell* : `addcell INDEX CELL` +
** *Add prisoner to cell* : `addcell INDEX CELL` +
e.g. `addcell 1 1-1` +
*Delete* : `delete INDEX` +
** *Delete* : `delete INDEX` +
e.g. `delete 1` +
*Delete prisoner from cell* : `deletecell INDEX` +
** *Delete prisoner from cell* : `deletecell INDEX` +
e.g. `deletecell 1` +
*Edit* : `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [r/ROLE] [t/TAG]...` +
eg. `edit 1 p/91234567 e/[email protected]`
** *Edit* : `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [r/ROLE] [t/TAG]...` +
eg. `edit 1 p/91234567 e/[email protected]` +
** *Delete User*: `deleteuser user/USERNAME_TO_DELETE` +
eg. deleteuser user/prisonguard1

* Security Level 3: +
*Add user* : `adduser user/NEW_USERNAME pw/NEW_PASSWORD sl/SECURITY_LEVEL` +
** *Add user* : `adduser user/NEW_USERNAME pw/NEW_PASSWORD sl/SECURITY_LEVEL` +
e.g. `adduser user/newuser pw/newpassword sl/1`
* *Calendar Delete Event* : `calDel EVENTNUMBER` +
e.g. `calDel 7`
*Add event to calendar* : `calAdd event/EVENTNAME loc/LOCATION start/STARTDATETIME end/ENDDATETIME` +
** *Calendar Delete Event* : `calDel EVENTNUMBER` +
e.g. `calDel 7` +
** *Add event to calendar* : `calAdd event/EVENTNAME loc/LOCATION start/STARTDATETIME end/ENDDATETIME` +
e.g. `calAdd event/IT Skills Training loc/Computer Lab 1 start/2018-06-06 10:00:00 end/2018-06-06 12:00:00` +

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
public class DeleteUserCommand extends UndoableCommand {
public static final String COMMAND_WORD = "deleteuser";
public static final String COMMAND_ALIAS = "du";
public static final int MIN_SECURITY_LEVEL = 2;

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes specified user.\n"
+ "Parameters: user/USERNAME_TO_BE_DELETED\n"
Expand Down Expand Up @@ -54,6 +55,14 @@ public CommandResult executeUndoableCommand() throws CommandException {
protected void preprocessUndoableCommand() {
}

@Override
/**
* Returns the MIN_SECURITY_LEVEL to caller
*/
public int getMinSecurityLevel() {
return MIN_SECURITY_LEVEL;
}

@Override
public boolean equals(Object other) {
return other == this // short circuit if same object
Expand Down
67 changes: 60 additions & 7 deletions src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,83 @@ public static Person[] getSamplePersons() {
return new Person[] {
new Person(new Name("Alex Yeoh"), new Phone("87438807"), new Email("[email protected]"),
new Address("Blk 30 Geylang Street 29, #06-40"), new Role("p"),
getTagSet("friends")),
getTagSet("Chicken Allergy")),
new Person(new Name("Bernice Yu"), new Phone("99272758"), new Email("[email protected]"),
new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), new Role("g"),
getTagSet("colleagues", "friends")),
getTagSet("Vegetarian")),
new Person(new Name("Charlotte Oliveiro"), new Phone("93210283"), new Email("[email protected]"),
new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), new Role("p"),
getTagSet("neighbours")),
getTagSet("Violent Tendencies")),
new Person(new Name("David Li"), new Phone("91031282"), new Email("[email protected]"),
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), new Role("g"),
getTagSet("family")),
getTagSet("Submission Jujitsu Trained")),
new Person(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("[email protected]"),
new Address("Blk 47 Tampines Street 20, #17-35"), new Role("p"),
getTagSet("classmates")),
getTagSet("Halal Diet")),
new Person(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("[email protected]"),
new Address("Blk 45 Aljunied Street 85, #11-31"), new Role("g"),
getTagSet("colleagues"))
getTagSet("Counsellor Trained")),
new Person(new Name("John Tan"), new Phone("85112935"), new Email("[email protected]"),
new Address("Blk 504 Elias Road, #22-11"), new Role("g"),
getTagSet("Sharpshooter")),
new Person(new Name("Abdulluh Muhammad"), new Phone("91882734"), new Email("[email protected]"),
new Address("Blk 45 Aljunied Street 85, #11-31"), new Role("g"),
getTagSet("Halal Diet")),
new Person(new Name("Max Balakrishnan"), new Phone("98672261"), new Email("[email protected]"),
new Address("Blk 402 Kent Ridge Street 9, #11-31"), new Role("g"),
getTagSet("MMA Trained")),
new Person(new Name("Xiang Tao"), new Phone("93255626"), new Email("[email protected]"),
new Address("38B Craig Road, 089676, Singapore"), new Role("g"),
getTagSet("Peanut Allergy")),
new Person(new Name("An Luo"), new Phone("89923718"), new Email("[email protected]"),
new Address("Blk 568 Ganges Avenue, 01-100 160568, Singapore"), new Role("g"),
getTagSet("Night Shift")),
new Person(new Name("Shui Peng"), new Phone("94772831"), new Email("[email protected]"),
new Address("63 Arab Street 199760, Singapore"), new Role("p"),
getTagSet()),
new Person(new Name("Xinyi Pan"), new Phone("89917238"), new Email("[email protected]"),
new Address("1 Pickering Street #07-03 Great Eastern Centre, 048659, Singapore"), new Role("p"),
getTagSet()),
new Person(new Name("Shi Mao"), new Phone("90197583"), new Email("[email protected]"),
new Address("10 Hoe Chiang Road #01-01 Keppel Towers, 089315, Singapore"), new Role("p"),
getTagSet()),
new Person(new Name("David Li"), new Phone("91031282"), new Email("[email protected]"),
new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), new Role("p"),
getTagSet("Submission Jujitsu Trained")),
new Person(new Name("Yimu Huang"), new Phone("89371844"), new Email("[email protected]"),
new Address("227 Ubi Avenue 4, 408815, Singapore"), new Role("p"),
getTagSet()),
new Person(new Name("Dan Zhan"), new Phone("97773917"), new Email("[email protected]"),
new Address("166 Upper East Coast Road 455270, Singapore"), new Role("p"),
getTagSet()),
new Person(new Name("Rachiket Arya"), new Phone("99283411"), new Email("[email protected]"),
new Address("143 Cecil Street #16-04 Gb Building, 069542, Singapore"), new Role("p"),
getTagSet()),
new Person(new Name("Hafiz Muhammad"), new Phone("89923645"), new Email("[email protected]"),
new Address("Golden Sultan Plaza 100 Jalan Sultan #01-32 199001, Singapore"), new Role("p"),
getTagSet("Halal Diet")),
new Person(new Name("Vinodhanan S/O Balakrishnan"), new Phone("88199374"), new Email("[email protected]"),
new Address("Blk 402 Kent Ridge Street 9, #11-31"), new Role("p"),
getTagSet()),
new Person(new Name("Philos Tsai"), new Phone("81227783"), new Email("[email protected]"),
new Address("11 Chancery Lane #01-04, 309502, Singapore"), new Role("p"),
getTagSet("Speaks French")),
new Person(new Name("Sarah Goh"), new Phone("90288173"), new Email("[email protected]"),
new Address("Tung Ann Association Building 141 Cecil Street #03-02/04 069541, Singapore"), new Role("p"),
getTagSet())
};
}

public static User[] getSampleUsers() {
return new User[] {
new User("prisonguard", "password1", 1),
new User("prisonleader", "password2", 2),
new User("prisonwarden", "password3", 3)
new User("prisonwarden", "password3", 3),
new User("prisonguard2", "password1", 1),
new User("prisonguard3", "password1", 1),
new User("prisonleader2", "password2", 2),
new User("prisonleader3", "password2", 2),
new User("prisonwarden2", "password3", 3)
};
}

Expand Down

0 comments on commit 75ad24f

Please sign in to comment.