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

[r/boards] initialize board creation #3140

Closed
6 tasks done
salmad3 opened this issue Nov 17, 2024 · 0 comments
Closed
6 tasks done

[r/boards] initialize board creation #3140

salmad3 opened this issue Nov 17, 2024 · 0 comments
Assignees

Comments

@salmad3
Copy link
Member

salmad3 commented Nov 17, 2024

Context:

Board creation is a fundamental operation in r/boards, requiring role-based permission checks to ensure that only authorized users can create boards. Initially, this logic will not depend on an external DAO but will integrate with the DefaultPermissions struct for access control. The board creation logic must include validation of board names, prevention of conflicts with existing usernames in the users realm, and adherence to naming rules.

Acceptance Criteria:

  • Provides a CreateBoard function that validates user permissions.

    Example
    func (bp *BoardsRealm) CreateBoard(user User, boardName string) {
        bp.WithPermission(user, "create", []interface{}{boardName}, func(args []interface{}) {
            // Actual board creation logic
            board := NewBoard(boardName, user)
            bp.boards[boardName] = board
        })
    }
  • Ensure that only users with sufficient permissions (i.e., Owner, Admin) can create a board.

  • Implements edge case handling:

    • Prevent using wallet addresses as board names.
    • Disallow board names that conflict with usernames unless owned by the creator.
  • Implements callback functions to support potential DAO integration for future extensibility.

  • Ensures integration with DefaultPermissions to manage board creation validation and user roles.

  • Includes unit tests to verify board creation behavior, including name validation and edge cases.

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

No branches or pull requests

2 participants