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

fix: simplified member role in configuration #119

Conversation

gentlementlegen
Copy link
Member

@gentlementlegen gentlementlegen commented Jan 4, 2025

Resolves #118
QA: Meniole#54

@gentlementlegen
Copy link
Member Author

/help

Copy link

Available Commands

Command Description Example
/help List all available commands. /help
/allow Allows the user to modify the given label type. /allow @user1 label
/ask Ask any question about the repository, issue or pull request /ask
/query Returns the user's wallet, access, and multiplier information. /query @UbiquityOS
/start Assign yourself and/or others to the issue/task. /start
/stop Unassign yourself from the issue/task. /stop
/wallet Register your wallet address for payments. Use '/wallet unset' to unlink your wallet. /wallet ubq.eth

@gentlementlegen
Copy link
Member Author

/ask what are the changes in this pull-request about?

Copy link

This pull request primarily focuses on simplifying and consolidating user roles within the command-start-stop plugin. Previously, multiple roles such as admin, member, collaborator, contributor, owner, billing_manager, write, and read were used to manage permissions and task assignments. The changes introduce a streamlined role system by grouping these into two main categories: collaborator and contributor.

Key modifications include:

  • Configuration Updates: The .ubiquity-os.config.yml and plugin-input.ts files have been updated to reflect the new role structure, removing the complexity of multiple roles and setting default limits for collaborators and contributors.

    maxConcurrentTasks:
      collaborator: 10
      contributor: 2
  • Code Refactoring: Functions responsible for determining user roles and task limits, such as getUserRoleAndTaskLimit, have been refactored to accommodate the new roles. Helper functions like isAdminRole and isCollaboratorRole ensure accurate role assignments.

  • Testing Enhancements: Test cases in files like roles.test.ts and configuration.test.ts have been updated to validate the new role configurations and ensure that task limits are enforced correctly based on the simplified roles.

  • Permissions Handling: The logic for starting and stopping tasks has been adjusted to verify user permissions against the new collaborator and contributor roles, ensuring that only authorized users can perform these actions without unnecessary restrictions.

  • Documentation: The README has been revised to reflect the changes in role management, providing clearer guidance on how hunters can use the /start and /stop commands under the new role system.

Overall, these changes aim to enhance maintainability, reduce configuration complexity, and ensure a more straightforward permission management system within the plugin.

@gentlementlegen gentlementlegen marked this pull request as ready for review January 11, 2025 05:36
src/types/plugin-input.ts Outdated Show resolved Hide resolved
@gentlementlegen gentlementlegen merged commit 5fb457d into ubiquity-os-marketplace:development Jan 12, 2025
2 checks passed
@gentlementlegen gentlementlegen deleted the fix/member-role branch January 12, 2025 17:05
@gentlementlegen
Copy link
Member Author

Updated configuration for this as well. I wish we had the frontend for this because I am sure I missed some repos with custom configs.

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

Successfully merging this pull request may close these issues.

Simplify role limits by grouping all the roles under "collaborator" and "contributor"
2 participants