Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to delete passwords on public links when password is enforced but permission is set #9857

Merged
merged 5 commits into from
Oct 26, 2023

Conversation

AlexAndBear
Copy link
Contributor

@AlexAndBear AlexAndBear commented Oct 24, 2023

Description

We've enabled to ability to allow delete passwords on public links, even if the password is enforced.
Therefore, the user needs respective permission, granted by the server.
This feature is only possible on public links that have the viewer role.

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • ...

@update-docs
Copy link

update-docs bot commented Oct 24, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@AlexAndBear
Copy link
Contributor Author

AlexAndBear commented Oct 24, 2023

issues:

  • password banned list errors not shown in frontend -> followup
  • links will be crated again instead of copied
  • copy link from context menu doesn't work

Comment on lines -77 to -96
const passwordEnforced =
store.getters.capabilities?.files_sharing?.public?.password?.enforced_for?.read_only ===
true

if (passwordEnforced) {
return showQuickLinkPasswordModal(
{ store, $gettext: language.$gettext, passwordPolicyService },
async (password) => {
await copyQuicklink({
ability,
clientService,
language,
password,
resource: item,
store
})
}
)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

centralized

@AlexAndBear AlexAndBear marked this pull request as ready for review October 25, 2023 09:32
@AlexAndBear AlexAndBear changed the title Ocis/issues/7538 Allow to delete passwords on public links when password is enforced but permission is set Oct 25, 2023
@sonarcloud
Copy link

sonarcloud bot commented Oct 25, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

55.8% 55.8% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@@ -338,7 +342,7 @@ export default defineComponent({
})
}
}
if (!this.isPasswordEnforced && !this.link.password && !this.isAliasLink) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh I don't get this check in the first place? If password is not enforced we don't allow the user to add a password ?

Copy link
Contributor

@JammingBen JammingBen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@AlexAndBear AlexAndBear merged commit ccadddb into master Oct 26, 2023
1 of 2 checks passed
@delete-merged-branch delete-merged-branch bot deleted the ocis/issues/7538 branch October 26, 2023 08:13
AlexAndBear added a commit that referenced this pull request Dec 13, 2023
…ut permission is set (#9857)

* Allow to remove password on public link if permission allows

* Fix bug where password prompt did instant pop up

* Refactor

* Remove unused capability

* Fix unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Link Password based on permission
2 participants