Due to recent security restrictions, our organization would like to remove the (very powerful) “Customize Application” permission from our operations users; however, these users actively manage our Queues for leads.
Does anyone know if it is possible to create a VisualForce / Apex Controller customization that would allow a user WITHOUT the “Customize Application” permission to manage Queue membership? Any help is greatly appreciated!
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
This seems to be possible. I just performed this simple test as a user without that permission without any problems, so if I understand the question correctly I think the answer is yes.
Page:
<apex:page controller="TestQueueMembership"> <apex:messages /> <apex:form > <apex:commandButton value="Test" action="{!toggle}"/> </apex:form> </apex:page>
Controller:
public class TestQueueMembership { public PageReference toggle() { List<GroupMember> groups = [select Id from GroupMember where Group.Type = 'Queue' and GroupId = '00Gb0000000RFBC' and UserOrGroupId = '005b0000000TPaL']; if( !groups.isEmpty() ) { delete groups; ApexPages.addMessage( new ApexPages.Message(ApexPages.Severity.INFO, 'Removed user from Queue') ); } else { insert new GroupMember( GroupId = '00Gb0000000RFBC', UserOrGroupId = '005b0000000TPaL' ); ApexPages.addMessage( new ApexPages.Message(ApexPages.Severity.INFO, 'Added user to Queue') ); } return null; } }
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0