Lightning Web Component that provides a general manager UI great for Lookup and Assign scenarios common to Setup application.
- Record Sharing
- Selecting Approval process initial submitters
- Adding Approvers to Approval Step Definitions ...
Administrator can add roleManager component to any object if it has corresponding RoleManager. Each role manager has set of allowed actions. Admin is able to control object types that is going to be used in member.
- Edit Tab Name* - Name of the tab, which is used to show existing members (Remove Members)
- Add Tab Name* - Name of the tab, which is used to add new members (Add Members)
- Supported Add Capabilities* - Action names, which will be shown on Add Tab (Read, Read/Write)
- Supported Edit Capabilities* - Action names, which will be shown on Edit Tab (None)
- Manager Name* - name of apex class, which is used as a manager (ManageSharingSettings)
- Available Object Types* - Supported objects types (User, Role...)
*required parameter
- User
- Role_subordinates
- Role
- Group
- Queue
Developer can add another types by extending SearchUtils class.
- ManageSharingSettings - used for record sharing, utilizes Salesforce standard sharing mechanism. Object needs to support sharing.
1.1 'Read' - sets read access for selected member
1.2 'None' - removes access for selected member
1.3 'Read/Write' - sets read/write access for selected member
- ManageApprovalStepApprovers - manager to add/remove step approvers to/from approval process
1.1 'Add' - add member to Approval Process Step Approvers
1.2 'Remove' - remove member to Approval Process Step Approvers
- ManageApprovalInitialSubmitters - manager to add/remove initial submitters to/from approval process
1.1 'Add' - add member to Approval Process Initial Submitters
1.2 'Remove' - remove member from Approval Process Initial Submitters
In addition to everything that admin can do, developer can add its own manager classes, thus extending standard functionality. Each Manager Class has to implement RoleManagerProvider with following methods:
1. String execute(String buttonName, String paramsString) - method to execute button action
2. List<RoleManagerController.MemberInfo> getExisting(String recordId) - method to get existing members for specified in parameters record Id
3. List<RoleManagerController.ButtonSetting> getSupportedButtons(String recordId) - method to get supported buttons. Developer has to include all buttons that should be supported return statement of this method.
Developer is able to control action availability by setting up ButtonSettings. Each ButtonSetting has ButtonMatchingRule which determines whether button is disabled or not and disabledValues.
class ButtonMatchingRule {
@AuraEnabled global MatchingAction matchingAction;
@AuraEnabled global Map<String, List<String>> disabledValues;
}
enum MatchingAction {
EXISTS, NOTEXISTS, VALUEEQUALS, SUPPORTED
}
EXISTS - button is disabled if member exists in member table
NOTEXISTS - button is disabled if member does not exist in member table
VALUEEQUALS - button is disabled if value in member table equals values passed to disabledValues attribute of ButtonMatchingRule class
SUPPORTED - button is always enabled
Is map of values for each field which will make the button disabled
This example will make button disabled if Type__c field of Member equals to 'Queue' or 'Group' :
new Map<String, List<String>>{
'Type__c' => (new List<String>{
'Queue', 'Group'
}