You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Private boards allow users to create and manage boards that are only visible to invited members. They leverage allowlisting and enable confidentiality and access control.
Acceptance Criteria:
Includes a PrivateBoard struct that extends the basic Board struct:
Checks if the user has permission to create a private board
Initializes a new PrivateBoard with the creator as the first invited member
Stores the new private board in the system
Example
func (bp*BoardsRealm) CreatePrivateBoard(userUser, boardNamestring) error {
if!bp.HasPermission(user, "create_private_board", []interface{}{boardName}) {
returnerrors.New("user does not have permission to create a private board")
}
newBoard:=&PrivateBoard{
Board: Board{
Name: boardName,
Creator: user.Address,
},
InvitedMembers: []Address{user.Address},
}
bp.privateBoards[boardName] =newBoardreturnnil
}
Implements an InviteMember method for PrivateBoard:
Allows only the board owner or admins to invite new members
Adds the invited member's address to the InvitedMembers list
Example
func (pb*PrivateBoard) InviteMember(inviterUser, inviteeAddress) error {
if!pb.isOwnerOrAdmin(inviter) {
returnerrors.New("only board owner or admins can invite new members")
}
for_, member:=rangepb.InvitedMembers {
ifmember==invitee {
returnerrors.New("user is already a member of this board")
}
}
pb.InvitedMembers=append(pb.InvitedMembers, invitee)
pb.sendInvitationNotification(invitee)
returnnil
}
func (pb*PrivateBoard) isOwnerOrAdmin(userUser) bool {
returnuser.Address==pb.Creator||pb.hasAdminRole(user)
}
func (pb*PrivateBoard) hasAdminRole(userUser) bool {
[...]
returnfalse
}
}
Ensures that private boards are not visible in public board listings or searches
Implements access control for private boards:
Only allow invited members to view, post, and interact with the board
Restrict non-members from accessing any content within the private board
Includes a LeavePrivateBoard function for members to remove themselves from a private board
Implements a DeletePrivateBoard function that can only be executed by the board owner
Unit tests verify the functionality of private boards, including:
Creation of private boards
Invitation and removal of members
Access control for members and non-members
Notes:
Private boards should not be included in any public board statistics or listings
Consider implementing a way for Admins to view high-level details of private boards (e.g., name, owner, number of members) without accessing the content
The text was updated successfully, but these errors were encountered:
Context:
Private boards allow users to create and manage boards that are only visible to invited members. They leverage allowlisting and enable confidentiality and access control.
Acceptance Criteria:
Includes a
PrivateBoard
struct that extends the basicBoard
struct:Example
Includes a
CreatePrivateBoard
function that:PrivateBoard
with the creator as the first invited memberExample
Implements an
InviteMember
method forPrivateBoard
:InvitedMembers
listExample
Ensures that private boards are not visible in public board listings or searches
Implements access control for private boards:
Includes a
LeavePrivateBoard
function for members to remove themselves from a private boardImplements a
DeletePrivateBoard
function that can only be executed by the board ownerUnit tests verify the functionality of private boards, including:
Notes:
The text was updated successfully, but these errors were encountered: