28 February 2013

SOQL Pinball Wizard Cleans Up Permission Sets



We had a chatter conversation internally yesterday that I'd like to share with you. A salesforce.com success manager wanted help with a customer who believed that they had too many permission sets and wanted to review which permission sets could be cleaned up.

Doug Bitting (@SFDCDoug) heeded the call and came up with some most excellent SOQL queries. I posted about using SOQL to determine your user's permissions in an earlier blog. In this posting, I'll focus exclusively on some more advanced SOQL but it's important to remember that anyone can run SOQL using a tool like workbench or data loader.

Use case: I want to find all permission sets that are only assigned to inactive users so that I can decide whether to unassign and delete:

SELECT Name 
FROM PermissionSet
WHERE IsOwnedByProfile = false
And Id Not In (
               SELECT PermissionSetId 
               FROM PermissionSetAssignment
               WHERE Assignee.IsActive = true
               )  

Use case: I want to find all permission sets that are not assigned to anyone so that I can decide whether to merge or delete.

SELECT Name  
FROM PermissionSet
WHERE IsOwnedByProfile = false
And Id NOT IN (
               SELECT PermissionSetId 
               FROM PermissionSetAssignment
               )

Using SOQL gives you a lot of flexibility to find a needle in a haystack and manage your permission sets. I hope this helps you manage your permission sets!


7 comments:

  1. This also my first time log in blog .I also hope can ,Let us share our mood.thank you for share, nice blog you have posted for further cleaning companies calgary
    Thanks for share that....

    ReplyDelete
    Replies
    1. Andy - please clarify your use case? This looks like an advertisement for Calgary Trusted Cleaners. If it is, I will have to delete this comment from the blog. If not, I would like to clarify what you are asking. Please let me know, otherwise, I will delete within one week. Thanks!

      Delete
  2. unity game development company
    ui ux design company usa
    ios game development company
    mobile game development company usa
    ui ux design services company
    digital marketing services usa
    best custom software development
    digital marketing company in usa
    ui ux design agency
    ios app development company
    game development company
    Underground Studio is a leading Unity 3D Mobile games Development Company based in the USA that offers Unity 3D games development, IOS app development by expert Unity 3D games developer with the best software developers to provide custom software development for companies of all sizes.

    ReplyDelete
  3. There are some interesting points in time in this article Arlo pro black Friday but I don’t know if I see all of them center to heart. There is some validity but I will take hold opinion until I look into it further. Good article, thanks and we want more! Added to FeedBurner as well like a boss

    ReplyDelete