我是靠谱客的博主 激动树叶,最近开发中收集的这篇文章主要介绍在Salesforce中使用SOQL查找Profile相关权限,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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相关权限所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(55)

评论列表共有 0 条评论

立即
投稿
返回
顶部