New issue
Advanced search Search tips

Issue 849999 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 849997



Sign in to add a comment

Store restrictions instead of capabilities in Files App

Project Member Reported by sashab@chromium.org, Jun 6 2018

Issue description

Since most files have full read-write access, it may simplify the logic (and perhaps save memory) to only store capabilities for entries whose values differ from the defaults.

This means, instead of storing:
  canCopy
  canDelete
  canRename
  canAddChildren
  canShare
for every entry, just store:
  copyRestricted
  deleteRestricted
  renameRestricted
  addChildrenRestricted
  shareRestricted
for entries that have these accesses restricted (Naming TBD).

Also, to further save memory, this could be represented as an array, or set of flags.
 
Labels: -M-69

Comment 2 by noel@chromium.org, Jun 6 2018

Makes sense to me.
Ahh damn I was so close to getting bug number 85000.... ;)
Sorry, did I say 85000? I meant 850000 D:

(see  issue 850000 )

Comment 5 by noel@chromium.org, Jun 6 2018

(I wonder who has  issue 888888 )

Comment 6 by sashab@chromium.org, Jun 13 2018

While fixing this, we should also fix the "undefined" problem.

Currently, some entries retreived from the cache can have canCopy (for example) set to undefined. For example:
* If the metadata is not fetched from the server yet
* If there is a problem with the cache and we don't have the data for canCopy

We should fix the API and the metadata provider to set these to a default value (e.g. true) so that the UI doesn't have to.

Comment 7 by sashab@chromium.org, Jun 13 2018

To append to above: this would clean up checks like "metadata.all(item => item.canCopy !== false)" (since it can be true or undefined, but not false).
Owner: ----
Status: Available (was: Assigned)

Sign in to add a comment