The new 'Move and copy' operation from #6040 requires UPDATE permissions
on the selected files. However, READ would be sufficient to create a
copy of a file (if not viewed as a public share). For this reason this patch:
- changes the permission of the 'MoveCopy' action to PERMISSION_READ
- changes the label of the action depending on the permissions
- changes the available buttons in the Move/Copy dialog depending on the
permissions.
The same changes are done to the filelist view for bulk actions.
Signed-off-by: Roland Tapken <roland@bitarbeiter.net>
In the same way that other elements can know when a FileAction is
registered or a default action is set this commit makes possible to be
notified before and after a FileAction is executed.
This is achieved by wrapping the registered action handler in a custom
function that notifies the listeners before and after executing the
handler itself. Due to this approach only FileActions registered through
"registerAction" trigger the events, although that is not a problem as
this is how the actions should be added to the FileActions anyway.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Now a file gets its directory permissions only if it contained no
permissions (they were undefined or null), but not if its permissions
were set to "NONE".
Besides that, now file actions that do not require any permission on the
file to be performed can be used on files that have no permissions.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Icon class function properties make possible to render a different icon
class depending on the context of the file action.
Inline file actions had support for them already and called them passing
the file name and context of the file action as parameters. Due to this
the FileActionsMenu passes those parameters too to icon class functions
instead of just the context like done for display name functions.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
For received shares, the delete action becomes "Unshare" and for
personal mounts it becomes "Disconnect storage".
This also makes it possible from now on to pass a function to a file
action's "displayName" attribute.
This reverts an older decision where we said the delete action must
always appear but be grayed out when the permission is missing.
The actions menu obsoletes that.
The favorite icon in the sidebar now triggers the file action and also
updates itself according to the model's state when triggered from the
file row.
The thumbnail triggers the default action.
Currently only one FileInfoModel is used for the selection and state
synchronization between views.
FileList reload now auto-closes the sidebar.
Default renderer like the favorite icon can decide whether to use the
permanent class or not.
Fixed sharing code to properly update the icon according to sharing
state modifications.
* this code adds a cookie when a special get parameter is set
* the content of this get parameter is used as value for the cookie
* the cookie expires after 20 seconds
* the JS code checks every 500 milliseconds for the cookie
-> if the cookie is set the request returned and the download is started