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

Feature - Add Custom Share Permissions #14729

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Mar 26, 2025

  • Tests written, or not not needed

@alperozturk96 alperozturk96 changed the title Feature - Add Share Permissions Feature - Add Custom Share Permissions Mar 27, 2025
/**
* get the permissions on the basis of selection
*/
private fun getSelectedPermission() = when {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No need this function anymore. clickEvents assigns value for the permission

@nextcloud nextcloud deleted a comment from github-actions bot Mar 27, 2025
@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch from cbf504a to c27d9ee Compare March 27, 2025 10:30
@nextcloud nextcloud deleted a comment from github-actions bot Mar 27, 2025
@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch 2 times, most recently from bf9eb82 to 5eae6b1 Compare April 1, 2025 14:43
Comment on lines -40 to -87
/**
* Sets checked/visibility state on the given {@link MenuItem} based on the given criteria.
*
* @param menuItem the {@link MenuItem} to be setup
*/
public static void setupHideFileDownload(MenuItem menuItem,
boolean hideFileDownload,
boolean isFileDrop) {
if (isFileDrop) {
menuItem.setVisible(false);
} else {
menuItem.setVisible(true);
menuItem.setChecked(hideFileDownload);
}
}

/**
* sets up the password {@link MenuItem}'s title based on the fact if a password is present.
*
* @param password the password {@link MenuItem}
* @param isPasswordProtected flag is a password is present
*/
public static void setupPasswordMenuItem(MenuItem password, boolean isPasswordProtected) {
if (isPasswordProtected) {
password.setTitle(R.string.share_password_title);
} else {
password.setTitle(R.string.share_no_password_title);
}
}

/**
* sets up the expiration date {@link MenuItem}'s title based on the fact if an expiration date is present.
*
* @param expirationDate the expiration date {@link MenuItem}
* @param expirationDateValue the expiration date
* @param res Resources to load the corresponding strings.
*/
public static void setupExpirationDateMenuItem(MenuItem expirationDate, long expirationDateValue, Resources res) {
if (expirationDateValue > 0) {
expirationDate.setTitle(res.getString(
R.string.share_expiration_date_label,
SimpleDateFormat.getDateInstance().format(new Date(expirationDateValue))
));
} else {
expirationDate.setTitle(R.string.share_no_expiration_date_label);
}
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unused functions

@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch from 3fcc813 to 1b1bc00 Compare April 2, 2025 09:18
@nextcloud nextcloud deleted a comment from github-actions bot Apr 2, 2025
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
@alperozturk96 alperozturk96 force-pushed the feature/add-share-permissions branch from 322132d to 351e29c Compare April 2, 2025 13:35
Signed-off-by: alperozturk <[email protected]>
Copy link

github-actions bot commented Apr 2, 2025

Codacy

Lint

TypemasterPR
Warnings5455
Errors1111

SpotBugs

CategoryBaseNew
Bad practice6565
Correctness5858
Dodgy code292288
Experimental11
Internationalization77
Malicious code vulnerability11
Multithreaded correctness77
Performance5151
Security1818
Total500496

Lint increased!

Copy link

github-actions bot commented Apr 2, 2025

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

Copy link

github-actions bot commented Apr 2, 2025

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/14729.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

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

Successfully merging this pull request may close these issues.

1 participant