Ticket #2621 (new enhancement)

Opened 2 months ago

Last modified 1 month ago

Suggested change to the Members::inGroups() function

Reported by: scott@… Assigned to: scott@…
Type: enhancement Priority: medium
Milestone: Component: Sapphire Framework
Version: 2.2.2 Severity: medium effort / impact
Keywords: member groups Cc: scott@startgrid.com
Due date: Harvest Task: (Unknown)
Invoice sent to client: 0 Hours:

Description

To check a member's permissions by group Title is unreliable as a title can be duplicated. Consider changing (rev. 56219) line 555 from:

$memberGroups[] = $group->Title;

to:

$memberGroups[] = $group->ID;

Has been tested with users in multiple groups.

Attachments

Change History

Changed 1 month ago by sminnee

  • type changed from patch to enhancement

This breaks backward compatibility. Perhaps you could make a version of this function that would let people a list of either group IDs or titles?

Since there's a risk of breaking backward compatibility with this, you should also make a unit test confirming that passing an array of titles still works.

Changed 1 month ago by sminnee

  • owner changed from sminnee to scott@startgrid.com
Note: See TracTickets for help on using tickets.