We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Change secondary roles along with primary role

How Do I?

adlur's avatar
adlur
104 posts
one year ago
adlur's avatar adlur

When a user is assigned a primary role they are also assigned the corresponding secondary role. If the user’s primary role is changed the corresponding secondary role remains, leaving them in both member groups. How can I configure EE so that secondary roles match primary roles?

For example:

Member registers and is assigned to “all access” role. This is applied to their primary and secondary roles. Member downgrades account and is moved to “partial access” role. Their primary role reflects this, but now they are members of both “all access” and “partial access” secondary roles.

TIA

       
Tom Jaeger's avatar
Tom Jaeger
449 posts
one year ago
Tom Jaeger's avatar Tom Jaeger

Hi,

Great question… How is the user downgrading currently?

Thanks,

-Tom Jaeger

       
adlur's avatar
adlur
104 posts
one year ago
adlur's avatar adlur

The User add-on edit function and its corresponding select_member_groups variable pair. A shortened version of the working form:

{exp:user:edit allowed_groups="5|9" return="directory/profile"}
<select name="group_id" class="med"> 
{select_member_groups} 
<option value="{group_id}" {selected}>{group_title}</option> 
{/select_member_groups} 
</select>
{/exp:user:edit}
       
Tom Jaeger's avatar
Tom Jaeger
449 posts
one year ago
Tom Jaeger's avatar Tom Jaeger

So I believe that tag in User will just set the Primary role… Not sure if you can setup your template checks to be against primary role for what your building?

We discussed this one internally, sounds like we need to add a remove role to the EE Core, as it’s currently missing.

Thanks,

-Tom Jaeger

       
adlur's avatar
adlur
104 posts
one year ago
adlur's avatar adlur

Yes, the tag in User is changing the Primary Role, which is what it is needed to do – the issue is with the Secondary Role that remains unchanged.

The website caters to a private, members-only group with two member groups/roles: “receive all notifications” (receives an email alert any time content is added/changed) and “receive official notifications” (receives an email alert when information that the organization is required to send to its members is added/changed.)

When a pending member is approved they are added to the Primary Role “receive all notifications.” (This process also adds them to the same Secondary Role, which is assumed to be expected behavior.) Users who prefer to receive fewer notifications have the option to change their Primary Role to “official notifications,” but doing so does not change the Secondary Role and they effectively remain in both Roles: their Primary Role is “official notifications” and their Secondary Role is “all notifications.”

The add-on used to generate emails to members (Mail After Edit) is Role based and does not differentiate between Primary and Secondary Roles. As a result, messages that are configured to go to the Primary Role “receive all notifications” are being delivered to all members because all members have “receive all notifications” as either their Primary and/or Secondary Role.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.