forked from ritalui/gdoc-access-app
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
75 lines (64 loc) · 3.13 KB
/
README
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Google Docs support for Expertiza
--------------------------------------------------------------------------------
TEAM
--------------------------------------------------------------------------------
Neelam Chitnis: [email protected]
Chetana Kethinedi: [email protected]
Rita Lui: [email protected]
--------------------------------------------------------------------------------
PROJECT GOALS
--------------------------------------------------------------------------------
This is a prototype Rails app developed to demonstrate how to access a user's
Google files using Google Drive API. It serves as a proof of concept for
implementing Google Docs support in Expertiza.
--------------------------------------------------------------------------------
SEED DATA
--------------------------------------------------------------------------------
Due to time constraints, admin funtions were not implemented, even though the
user model supports such notion. In config/seeds.rb, the following data is
seeded:
* 1 admin
* 3 users
* 3 assignments
* the linking of users to assignments is hardcoded in submitted_works table
via seed data
--------------------------------------------------------------------------------
DEVELOPMENT
--------------------------------------------------------------------------------
1. Edit config/initializers/omniauth.rb and replace CLIENT_ID and CLIENT_SECRET
with the real info.
2. At the project's root directory:
$ bundle install
$ rake db:setup
2. To bring up Rails server:
$ rails s -b localhost
--------------------------------------------------------------------------------
FLOW OF EVENTS
--------------------------------------------------------------------------------
1. User signs in.
2. Upon successful authentication, user is directed to a task list that shows
the assignment he/she is assigned.
3. User wishes to submit a document from his/her Google account, so he/she
clicks on the Google icon to initiate the authroization/authentication
process.
4. User is re-directed to Google's server to be authenticated and asked to
grant this app access permissions to his/her files.
5. User is re-directed to his/her task list.
6. User clicks on a submit link and is asked to enter the name of the
Google file to be submitted.
7. This app uses the Google API client to search the file by name.
8. If the file is found, a new permission is added to the file to allow
"anyone with the link" to comment on the file.
9. User is re-directed back to the task list.
10. User can click on the review button to see a list of the files he/she
has submitted and their links.
11. Anyone can use the link(s) displayed to view the file and comment on the
file via a browser
--------------------------------------------------------------------------------
NOTES
--------------------------------------------------------------------------------
* omniauth and omniauth-google-oauth2 gems are used for oauth 2 authorization
and authentication
* google-api-client gem is used to interface with Google Drive API v2
* due to time constraints, there is no code that uses a refresh_token to get a
new access_token once it expires