You need to sign in to do that
Don't have an account?
Lakshman
How to validate if User has particular profile permission set in an Apex class?
Hi All,
I want to know how can I query for Users having a particular profile permission sets in an Apex class. I am doing following query:
SELECT PermissionSetId FROM PermissionSetAssignment WHERE AssigneeId= :UserInfo.getUserId() AND PermissionSet.Name = 'EntityFasadUser'
There is an compilation error as below:
Save error: sObject type 'PermissionSetAssignment' is not supported.
Please help me on this. Thanks in advance.
Regards,
Lakshman
Try changing the version of the classs to API version 22.0 and later.
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_permissionset.htm
All Answers
Try changing the version of the classs to API version 22.0 and later.
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_permissionset.htm
Cheers it works!!!
Thanks a lot.
Regard,
Lakshman
Hey buddy,
Inspite of changing the API version I still get this error for a profile, any thoughts on this?
Same error I am getting for a profile don't know what I need to enable in the permission set. Any help is appreciated.
Regarda,
Lakshman
Class and Page both are added. I think I am missing some System permission.
This is strange the PermissionSet object is not yet supported in VisulaForce Ajax API. When I query the same in the Apex class it works fine and when I try to query in the Page it doesnt.
But when I Enable Modify All permissions it works in page as well.
Still not able to get the exact cause. Did you get anything on this?
Regards,
Lakshman
try removing PermissionSetAssignment query out of your controller in a public class method and access that method from your controller.