Skip to content

Conversation

@rebeccals05
Copy link

Allow members of a new instructors group to create categories without giving full admin privileges.
Seed an instructors group during install/setup.
Add a test verifying that members of instructors can create categories.
Note: I added temporary debug logging to investigate a remaining test failure in privileges.categories.filterUids. Most category tests pass locally; one test still needs investigation. I can remove debug logging and fix the test before merging if you prefer.

@acee3 acee3 self-requested a review October 2, 2025 13:43
Copy link

@acee3 acee3 left a comment

Choose a reason for hiding this comment

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

Looks good but needs some minor changes


// DEBUG: inspect why certain uids are allowed
try {
console.log('[DEBUG privs.filterUids] privilege=%s cid=%s uids=%o allowedTo=%o isAdmins=%o', privilege, cid, uids, allowedTo, isAdmins);
Copy link

Choose a reason for hiding this comment

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

The try catch block here might not be necessary

const isInstructors = await Groups.isMember(id, 'instructors').catch(() => false);
return { id, username, isAdmin, isRegistered, isInstructors };
}));
console.log('DEBUG: uid info ->', info);
Copy link

Choose a reason for hiding this comment

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

Look into using console.debug

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.

3 participants