Blog

Salesforce: check if user has assigned permission set

April 15, 2015

Code to check if user has assigned permission set

1
2
3
4
5
6
7
8
static public Boolean checkIfUserHasAssignedPermissionSet(String userName, String permissionSetName) {
    List<PermissionSetAssignment> psas = [ select Id from PermissionSetAssignment where PermissionSetId IN ( select Id from PermissionSet where Name = :permissionSetName) and AssigneeId IN (select Id from User where UserName = :userName ) ];
    return psas.size() > 0;
}

Tags



Share


0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Articles

Part 2: Optimizing and scaling microservices. Organic growth of eco-systems.

October 11, 2017 | Nikola Krastev

A microservices approach is not a silver bullet for all software architecture problems. It introduces tradeoffs and challenges of its own. However, process gains and improvements in human performance have been considered to be worth the overhead in technology. Here are some general arguments against using sophisticated SOA. Server performance and overhead in communication By […]

CoreValue President at IT Arena 2017

September 27, 2017

We are pleased to announce that CoreValue president Igor Kruglyak will participate in IT Arena 2017, to be held in Lviv, Ukraine, September 29 – October 1, 2017.