Tim Pierce [Wed, 2 Jul 2014 12:59:58 +0000 (08:59 -0400)]
2873: changes for code review
Incorporating code review comments:
* @Link#get_permissions@ uses @Link.where@ instead of @find_objects_for_index@; @find_object_for_uuid@ just populates @@object@ with the head_uuid object and leaves @@objects@ alone.
* @ArvadosModel.lookup_by_uuid@ renamed @ArvadosModel.find_by_uuid@ and punts to the superclass if called as a subclass method.
* Test @get_permissions_returns_list@ checks that the :active user can get permissions. Also uses the group fixtures for testing permissions instead of collections (because can_manage permissions only work so far on users and groups.
UnixVolume has no business being loud about files that can not be found.
Just pass on the error to the caller and be quiet.
Back story: for every PUT, Keep checks if the block already exists.
Prior to this patch, UnixVolume would complain loudly if the block did
not already exist in the volume (i.e. the normal case for a PUT).
Peter Amstutz [Tue, 1 Jul 2014 15:38:27 +0000 (11:38 -0400)]
Change crunch-dispatch to use "git fetch-pack --all" insted of "git fetch" to
fetch entire repository instead of just the history for HEAD. This seems to be
the only way to ensure that arbitrary script version hashes not in the history
of the source's HEAD are fetched without using refs (tags or branches).
no issue #
Peter Amstutz [Tue, 1 Jul 2014 15:38:27 +0000 (11:38 -0400)]
Change crunch-dispatch to use "git fetch-pack --all" insted of "git fetch" to
fetch entire repository instead of just the history for HEAD. This seems to be
the only way to ensure that arbitrary script version hashes not in the history
of the source's HEAD are fetched without using refs (tags or branches).
no issue #
Brett Smith [Fri, 27 Jun 2014 18:37:34 +0000 (14:37 -0400)]
2891: Workbench reliably reloads model columns after failure.
ArvadosBase @columns could get stuck as [] if the API server wasn't
available during Workbench's first API request. This change ensures
that it keeps trying to reload column information until it receives
good data.
Brett Smith [Fri, 27 Jun 2014 18:30:38 +0000 (14:30 -0400)]
2891: Workbench renders login exceptions earlier.
These changes are designed to ensure that if there are any problems
getting information from the current API token (other than expected
401 Unauthorized responses), those problems are raised early and
propagated up to the exception handler. This helps better ensure that
thread state is consistent when we get to later stages of request
processing.
Brett Smith [Wed, 25 Jun 2014 20:39:24 +0000 (16:39 -0400)]
2891: Guard against API server errors in Workbench layout.
The goal here is to generally avoid situations like #3031 where
trouble talking to the API server prevents us from even rendering an
error page. Previous commits made us smarter about logged in status.
This guards against other API errors.
Brett Smith [Mon, 23 Jun 2014 19:28:48 +0000 (15:28 -0400)]
2891: Workbench API client raises structured exceptions.
These changes will make it easier for the rest of the Workbench code
to cope with these errors more gracefully—even if that just means
friendlier reporting of the error.
Brett Smith [Tue, 24 Jun 2014 15:38:50 +0000 (11:38 -0400)]
2891: API server assigns error tokens.
These unique tokens are both logged and sent along with the response,
making it easier to cross-reference what the client does with what
happens on the API server.
radhika [Mon, 30 Jun 2014 15:39:41 +0000 (11:39 -0400)]
2659: look for scopes and expires_at when getting anonymous token. also, update create anonymous user to check for group link even when the user exists.
Tim Pierce [Thu, 26 Jun 2014 18:17:48 +0000 (14:17 -0400)]
2873: add /permissions API method
The /permissions/:uuid method will return a list of all permissions that
the current user is allowed to see on the given uuid.
* New method LinksController::get_permissions, with a route from
/arvados/v1/permissions.
* LinksController overrides find_object_by_uuid to permit looking up a
uuid in any class, when called by get_permissions.
* Moved link permission checking to Link.ensure_owner_uuid_is_permitted.
* Use current_user.can? to check the user's permission on head_uuid.
Removed unnecessary owns? and can_manage? code.
* Unit tests:
* test/integration/permissions_test.rb: added tests:
* "get_permissions returns list"
* "get_permissions returns 404 for nonexistent uuid"
* "get_permissions returns 403 if user lacks manage permission"
* test/unit/link.rb: test that only permission and name links have
their ownership changed upon save.
* test/unit/permission_test.rb: test the following scenario: when user
"active" owns a group G which can_manage another group H, then
active user is permitted to create permission links directly on
objects in group H.