Hide revert button when no permission to revert #25288

Merged
merged 1 commit into from Jun 29, 2016

Projects

None yet

6 participants

@PVince81
Collaborator

Please review @icewind1991 @georgehrke @VicDeo @DeepDiver1975

We should backport this down to 8.0.
CC @DeepDiver1975 @dragotin

@PVince81 PVince81 Hide revert button when no permission to revert
6a1d9d0
@PVince81 PVince81 added this to the 9.1-current milestone Jun 28, 2016
@mention-bot

By analyzing the blame information on this pull request, we identified @schiessle, @icewind1991 and @bartv2 to be potential reviewers

@georgehrke
Contributor

How to test this?

I can still revert read-only shared files.

@PVince81
Collaborator

@georgehrke

  1. Setup OC
  2. As admin, create a user "user1"
  3. Create a folder "test"
  4. Create a file "test/test.txt", edit several times to create versions
  5. Share the folder "test" with "user1" with full permissions
  6. In a separate browser, login as "user1"
  7. Open the folder "test"
  8. Open the versions panel for "test" and see that there are multiple versions
  9. Back to admin's browser
  10. Remove edit permissions on "test"
  11. Back to user1's browser
  12. Click on of the "Revert" icons to revert a version

I tried again with both folder shares and file shares and it works correctly: cannot revert.
If you disabled the "can edit" permission, you might need to click outside the checkbox for the ajax request to go through when adjusting permissions, just in case.

@icewind1991
Member

Code looks good 👍

@VicDeo
Member
VicDeo commented Jun 28, 2016

@PVince81 tested, works 👍

@PVince81 PVince81 merged commit a29c650 into master Jun 29, 2016

21 of 22 checks passed

smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_sharePropagationInsideGroups,mirallBranch=v2.0.2,slave=SMASH Build #15734 in progress...
Details
Scrutinizer No new issues
Details
cla-bot-core Build #5056 succeeded in 58 sec
Details
continuous-integration/php-5.4 Build #5351 succeeded in 6 min 1 sec
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
core-ci-linux-jsunit/database=sqlite,label=SLAVE Build #63231 succeeded in 1 min 31 sec
Details
core-ci-linux/database=mysql,label=SLAVE Build #32124 succeeded in 12 min
Details
core-ci-linux/database=oci,label=SLAVE Build #32124 succeeded in 25 min
Details
core-ci-linux/database=pgsql,label=SLAVE Build #32124 succeeded in 19 min
Details
core-ci-linux/database=sqlite,label=SLAVE Build #32124 succeeded in 6 min 51 sec
Details
ocs-api-integration-tests-ci Build #11910 succeeded in 11 min
Details
server-master-linux-externals-ci/database=sqlite,external=smb-silvershell,label=SLAVE Build #11409 succeeded in 2 min 40 sec
Details
server-master-linux-externals-ci/database=sqlite,external=swift-ceph,label=SLAVE Build #11409 succeeded in 5 min 38 sec
Details
server-master-linux-externals-ci/database=sqlite,external=webdav-ownCloud,label=SLAVE Build #11409 succeeded in 8 min 35 sec
Details
server-master-linux-externals-smb-windows-ext-ci/database=sqlite,external=smb-windows,label=master Build #23083 succeeded in 2 min 58 sec
Details
server-master-linux-php7-ci/database=sqlite,label=SLAVE Build #40456 succeeded in 3 min 34 sec
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=litmus,mirallBranch=v2.0.2,slave=SMASH Build #15734 succeeded in 5 min 9 sec
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_basicSync@0,mirallBranch=v2.0.2,slave=SMASH Build #15734 succeeded in 1 hr 33 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_basicSync@1,mirallBranch=v2.0.2,slave=SMASH Build #15734 succeeded in 1 hr 30 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_shareLink,mirallBranch=v2.0.2,slave=SMASH Build #15734 succeeded in 12 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_sharePermissions,mirallBranch=v2.0.2,slave=SMASH Build #15734 succeeded in 1 hr 28 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_sharePropagationGroups,mirallBranch=v2.0.2,slave=SMASH Build #15734 succeeded in 16 min
Details
@PVince81 PVince81 deleted the fix-versionrevertperms branch Jun 29, 2016
@PVince81
Collaborator
PVince81 commented Jul 7, 2016

@jvillafanez @VicDeo mind helping to review the above backports as well ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment