Conversation
- Only show posts and comments - Cannot create posts or comments until subscribed - Hidind UI when no permissions
- Extension of restricted community - Do not show post and comments to unsubscribed user
- Gray out voting buttons - Use common component to show restricted access - Removed Create post button from about component card - Showing restriction banner in the create post page
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a comprehensive permissions system for communities, enhancing access control and user experience across posting, voting, and commenting features. It ensures that only users with the appropriate permissions can view communities, create posts, vote, or comment. Additionally, a new
RestrictedCommunityBannercomponent provides clear feedback to users when their access is limited. The changes touch several key components to consistently enforce these permissions throughout the app.Permissions Enforcement and Access Control:
Integrated the
useCommunityPermissionshook into major components (CommunityClientPage,PostClientPage,SubmitPostClientPage,About,Posts,Comments,CreatePostLink, and navbarIcons) to determine and enforce user permissions for viewing, posting, and commenting in communities. Components now conditionally render content or actions based on these permissions. (app/community/[communityId]/comments/CommunityClientPage.tsxR9-R12, app/community/[communityId]/comments/CommunityClientPage.tsxR45-R61, app/community/[communityId]/comments/[pid]/PostClientPage.tsxL44-R46, app/community/[communityId]/comments/[pid]/PostClientPage.tsxR65-L89, app/community/[communityId]/submit/SubmitPostClientPage.tsxR15-R16, app/community/[communityId]/submit/SubmitPostClientPage.tsxR42-R54, [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]Added logic to prevent users without the necessary permissions from accessing certain features:
canVieware shown a restricted banner instead of community content or posts. (app/community/[communityId]/comments/CommunityClientPage.tsxR45-R61, app/community/[communityId]/comments/[pid]/PostClientPage.tsxR65-L89, components/community/about/About.tsxR41-R45)canPostcannot see post creation options or interact with voting, and are shown appropriate messages or UI elements. (app/community/[communityId]/submit/SubmitPostClientPage.tsxR42-R54, [1] [2] [3] [4] [5]canComment, and comment input or reply options are hidden accordingly. [1] [2] [3] [4] [5] [6] [7]User Experience Improvements:
RestrictedCommunityBannercomponent to provide consistent, user-friendly feedback when access is restricted, with customizable titles and descriptions. (components/community/RestrictedCommunityBanner.tsxR1-R34, app/community/[communityId]/comments/CommunityClientPage.tsxR9-R12, app/community/[communityId]/comments/[pid]/PostClientPage.tsxR15, app/community/[communityId]/submit/SubmitPostClientPage.tsxR15-R16, app/community/[communityId]/submit/SubmitPostClientPage.tsxR42-R54)Code Organization:
CommunityClientPageto thecommentssubdirectory and updated imports accordingly for better file structure. (app/community/[communityId]/page.tsxL3-R3)Component and UI Adjustments:
About,Posts,PostItem, andCommentscomponents to accept new permission props and conditionally render UI elements (like create post buttons, voting, and comment input) based on user permissions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]These changes together provide a robust, consistent, and user-friendly permissions system across the community features.