This repository has been archived by the owner on Jul 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
structures.txt
executable file
·60 lines (50 loc) · 1.82 KB
/
structures.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
LocGroup
* require_role :admin, :for_all_except => [:shifts, :shifts_all]
* require_role :can_view, :only => [:shifts, shifts_all]
** checks if user can view shifts under this loc group or not, or any loc group at all
* shifts: display all shifts under a location
* shifts_all: display all shifts under all viewable location
Location
* require_role :admin, :for_all_except => [:shifts, :shifts_all]
* similar to loc group
Shift
* require_role :admin, :for => [:edit, :update, :destroy]
* new:
** reads time range, validate against time slots, validate against priority list
** if admin, allow selecting user
** if not admin, can only sign up if a time slot is open
** submit takes to action create
* not needed: show, index; because we will view shifts under a particular location or loc group
Report
* new: display shift information in order to sign in (alias route: sign_in)
** if shift_id is not given, display list of location to choose
** submit button takes user to create
* create:
** if shift_id is not given, create a shift with start, stop time as Time.now
** create first report_line
* edit:
** render reports/:report_id/report_lines/new
** submit report takes user to :update which creates the logout report_line message, update stop time
* show: display report's contents which are basically report_lines belonging to this report
* not needed: destroy; because a report is not allowed to be deleted
TimeSlot:
* should be nested under location?
* not needed: show
Access Control
* Each LocGroup has three permission levels
** view_perm
** signup_perm
** admin_perm
* Each role has many of such permissions
Examples:
loc group |view_perm_id|signup_perm_id|admin_perm_id
Public Cluster|1 |2 |3
permission:
id | name
1 | public_cluster_view
role_id|permission_id
1 |1
1 |2
1 |3
user_id | role_id
1 | 1