Skip to content

User can hide liked bookmarks from other users using server-side privacy#45

Open
lymichelle21 wants to merge 9 commits into
masterfrom
privacy
Open

User can hide liked bookmarks from other users using server-side privacy#45
lymichelle21 wants to merge 9 commits into
masterfrom
privacy

Conversation

@lymichelle21

Copy link
Copy Markdown
Owner

New stuff:

  • User can set their profile to private upon sign up (making their bookmarks accessible only by their account)
  • If a user clicks on the profile of a private user, their profile will not display any bookmarks and show a lock icon

Screenshots:

Screen Shot 2022-07-28 at 5 30 15 PM

Screen Shot 2022-07-28 at 5 30 34 PM

@lymichelle21 lymichelle21 added the stretch Stretch user story label Jul 29, 2022
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seems we are not logging anything so could you please remove this import.

@@ -1,5 +1,7 @@
package com.capstone.event_finder.activities;

import static androidx.constraintlayout.helper.widget.MotionEffect.TAG;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also check whether we need this or not

@bsmondal bsmondal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me. Please have a quick look into my comment

} else {
bookmarkAcl.setPublicReadAccess(true);
}
saveBookmark(eventId, eventCategory, currentUser, bookmarkAcl);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

✅ Thanks for giving ACL a try to ensure sever-side security of a user's private bookmarks.

user.put("event_categories_string", allInterestCategories);
user.put("profile_image", file);

user.put("private", isPrivate);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

❓ What happens to existing bookmarks when the user changes their privacy? Should we be looping through all the user's bookmarks and updating their ACL? (Remember we can't completely rely on the client-side check you're making in PosterProfileActivity)

private final EventApi eventApi;
private final List<Bookmark> userBookmarks = new ArrayList<>();
private final MutableLiveData<List<Event>> bookmarkList;
private final ArrayList<String> bookmarkIds = new ArrayList<>();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

✅ Thanks for making this change, it might seem trivial but will help avoid troubles in the future.

The "Clean Code" book I recommended has more information on this under "Chapter 3: Functions" under "Have No Side Effects".

}

private Collection<? extends Event> convertBookmarksToList(JsonArray result) {
private Collection<? extends Event> convertToList(JsonArray result) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

✅ Thanks for making this change, in this case, less code makes this cleaner!

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

Labels

stretch Stretch user story

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants