470 Commits

Author SHA1 Message Date
7eb72c87f5 Check if subscription count is more than 0 to subscribe to notifications 2016-05-11 16:12:14 +02:00
77184bbad0 Never return soft-deleted items in /latest/{assets,comments} 2016-05-11 12:33:59 +02:00
5b2d7447e6 Projects: limit returned projects to allowable projects.
Before this, if there was any project returned by a query on /projects
that the user did not have access to, a 403 would be returned. Now we
just don't include that project in the result.
2016-05-11 11:41:19 +02:00
58dbf0b228 Fixed typo 2016-05-10 18:20:01 +02:00
fe074715e1 Simplified files_make_public_t management command.
'except Exception: pass' is always bad.
2016-05-10 18:18:09 +02:00
0f0712205c Make thumbnails (variations of size 't') public. 2016-05-10 18:09:23 +02:00
6a07147e44 Disable XML interface.
Some of our code assumes Eve always returns JSON. Now this assumption
actually holds.
2016-05-10 15:06:36 +02:00
d3b3e0ff4f Commented out strip_link_and_variations(), to wait until we have is_public on files. 2016-05-10 13:38:07 +02:00
9362f9b539 Remove links from returned file docs when user is not subscriber/demo/admin.
For unauthenticated/non-subscriber users, image file documents retain
their variations. All other documents have ther variations stripped.
Also the links + expiry info to the original file are removed for all
file types.
2016-05-10 12:35:21 +02:00
62817eec40 Skip renaming file on GCS when testing.
This allows running this test while the internet is gone.
2016-05-10 12:33:38 +02:00
b894eb2477 Skip Algolia in unit tests.
Unit tests hang when our internet connection dropped.
2016-05-10 10:47:26 +02:00
0faecdb4fe More explicit assignment to is_private, for easier debugging 2016-05-10 10:47:26 +02:00
0dcb972e76 Project: Don't revert the is_private field.
This also reverts the changes of override_is_private_field().
2016-05-10 10:47:26 +02:00
d3f22efd27 Removed project name from project stats 2016-05-09 18:33:56 +02:00
a4ca7c621a Project stats: show stats for total/private/public projects. 2016-05-09 18:26:26 +02:00
be280d58f9 Fixed output of unicode in projects_stats mgmnt command 2016-05-09 17:53:20 +02:00
72ca0fe69c Add .blend to mimetypes module at import of file_storage.py
Previously we added this in override_content_type() when
`not mimetypes.inited`. However, it seems that this is never performed
when running at production, probably due to some WSGI container also using
the mimetypes module.
2016-05-09 15:31:43 +02:00
82608e60d3 Fixed bug for project['node_type'] permission fetching. 2016-05-09 14:33:55 +02:00
a90f13486a Fixed typo call to check_permissions()
Also added unit test to cover the function containing the typo.
2016-05-09 12:52:44 +02:00
4316c4d450 moved modules.mongo_utils to utils.mongo 2016-05-09 11:41:53 +02:00
369f75c689 Allow project creation by users with role=demo 2016-05-09 11:38:26 +02:00
8d273de4d8 Reduced noisy logging when auth tokens have expired. 2016-05-09 11:28:12 +02:00
d57bad36d5 Revert production hack, as it's no longer necessary. 2016-05-09 11:21:45 +02:00
042b744b6e Handle JSON request to /p/create
The Pillar Python SDK posts JSON, so we should handle that too.
2016-05-09 11:16:20 +02:00
8bb98aa280 Merge branch 'production' 2016-05-07 00:56:27 +02:00
3a4754d28b Hot fix for the fix. 2016-05-07 00:39:54 +02:00
666a5842a5 Fix for setting is_private on new permission-less projects 2016-05-06 19:11:58 +02:00
402981a6b1 Small fixes 2016-05-06 19:11:21 +02:00
2cdde04a8b Small code clarifications 2016-05-06 18:28:08 +02:00
899497b3b1 Implemented merging of permissions.
Permissions are now merged between project, node type and node, instead
of having the lower-level permissions override the higher-level
permissions.
2016-05-06 18:15:50 +02:00
4dc5b4dbbf Added manage.py project_stats command.
It counts file size, nr of nodes and nr of top-level nodes per project.
2016-05-06 17:41:00 +02:00
879a18ee68 Added 'manage.py refresh_file_sizes' to update all aggregate sizes.
Computes & stores the 'length_aggregate_in_bytes' fields of all files.
2016-05-06 12:43:45 +02:00
410ecac78c Reformatted manage.py 2016-05-06 12:43:45 +02:00
6f193da89d Added entry point /p/<project_id>/quotas
At the moment this entry point only returns the total file size of all
files belonging to the project. It can be extended to return more info,
such as nr. of nodes/groups/etc.
2016-05-06 12:43:45 +02:00
bbc30b9d99 Compute & store aggregate file size. 2016-05-06 12:43:45 +02:00
1bb2979428 Slight improvement to project group mgmnt tests 2016-05-06 12:43:45 +02:00
a2ce18196a Simplified permissions for projects.
Instead of the additional 'is_private' field, we now just use
the permission system and set/remove world GET permissions.

'is_private' is still kept for backward compatibility and possibly
easy querying for public projects, and is always set based on
world GET permissions.
2016-05-06 12:42:16 +02:00
758273edab Return target user after adding or removing it from project 2016-05-06 11:56:52 +02:00
2580466469 User management for projects
Support for retrieving user of a project.
2016-05-06 10:30:05 +02:00
ffa98d72e6 Sort fetched nodes by creation date 2016-05-04 18:28:45 +02:00
0b1664a83c Add project_manage_users endpoint
Manage users of a project. In this initial implementation, we handle
addition and removal of a user to the admin group of a project. No
changes are done on the project itself.
2016-05-04 17:04:10 +02:00
d93d1091f9 Fix for indexing if project is private 2016-05-04 15:55:20 +02:00
7b0c037529 Debug-log the subclient ID too 2016-05-04 14:06:27 +02:00
c248e8c11b Moved modules/latest/__init__.py to modules/latest.py 2016-05-04 09:34:58 +02:00
fb0629dcb0 Make logging less verbose for blender_id in production 2016-05-03 15:19:29 +02:00
80919dacb3 New add_license_props in manage.py 2016-05-03 14:47:33 +02:00
d0d8b7d11d Added missing unit test for content type overrides. 2016-05-03 11:23:26 +02:00
0389b05b14 Save temporary files in STORAGE_DIR
This makes it trivial to save uploaded files to STORAGE_DIR, as the
temporary files Flask saves them in are already there.
2016-05-03 11:22:54 +02:00
0580d3fa65 Removed some whitespace 2016-05-03 11:11:36 +02:00
54a2176d7c Override browser-given content type for certain types.
If the browser gives us audio/xxx, video/xxx or image/xxx, we just use
it. Otherwise the mimetypes package is used to guess the mime type
based on the file's extension.

Also ensures the content type of the file is updated in MongoDB. Does
NOT update any nodes that link to this file.
2016-05-03 10:57:56 +02:00