概述
Query specific field permission for all Profiles:
SELECT Profile.Name FROM PermissionSet WHERE IsOwnedByProfile = TRUE AND Id IN (SELECT ParentId FROM FieldPermissions WHERE FIELD ='Payment__c.Firm__c' AND SobjectType = 'Payment__c' AND PermissionsRead = TRUE AND PermissionsEdit = FALSE) ORDER BY Profile.Name
PermissionsRead --> View permission for the field.
PermissionsEdit --> Edit permission for the field.
The below approach also works but the profile name will be displayed as [Object Object] in Query Editor,
SELECT Parent.Profile.Name FROM FieldPermissions WHERE FIELD = 'Payment__c.Firm__c' AND Parent.IsOwnedByProfile = TRUE AND SobjectType ='Payment__c' AND PermissionsRead = TRUE AND PermissionsEdit = FALSE ORDER BY Profile.Name
Query specific object permission for all Profiles:
SELECT Profile.Name FROM PermissionSet WHERE IsOwnedByProfile = TRUE AND Id IN (SELECT ParentId FROM ObjectPermissions WHERE PermissionsRead = TRUE AND SObjectType = 'CustomObject__c') ORDER BY Profile.Name
You can check all object level permission in the query. Such as,
PermissionsRead
PermissionsCreate
PermissionsEdit
PermissionsDelete
PermissionsViewAllRecords
PermissionsModifyAllRecords
【参考】:
Field Permission | Object Permission | Query Which Profiles Have Read Access To Specific Object?
最后
以上就是激动树叶为你收集整理的在Salesforce中使用SOQL查找Profile相关权限的全部内容,希望文章能够帮你解决在Salesforce中使用SOQL查找Profile相关权限所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复