salesforce 各个功能的运行模式-system or user

本文深入解析了Salesforce中的System模式和User模式,System模式下,Apex代码无视用户权限,可访问所有对象和字段,而User模式则遵循用户的权限设置和记录共享规则。文章详细阐述了两种模式的应用场景及Salesforce中不同组件的执行模式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

System模式是无视profile和共有规则

user模式是考虑Profile和共有规则

from:

https://www.biswajeetsamal.com/blog/system-mode-and-user-mode-in-salesforce/

System Mode:

  • System mode is nothing but running apex code by ignoring user’s permissions. For example, if logged in user does not have create permission but they will able to create a record.
  • In system mode, Apex code has access to all objects and fields permissions, field-level security, sharing rules aren’t applied for the current user. This is to ensure that code won’t fail to run because of hidden fields or objects for a user.
  • In Salesforce, all apex code run in system mode. It ignores user’s permissions. Only exception is anonymous blocks like developer console and standard controllers. Even runAs() method doesn’t enforce user permissions or field-level permissions, it only enforces record sharing.

User Mode:

  • User mode is nothing but running apex code by respecting user’s permissions and sharing of records. For example, if logged in user does not have create permission they are not able to create a record.
  • In User mode, Profile level permissions, field-level security, and sharing rules are applied for the current user.
  • In Salesforce, only standard controllers and anonymous blocks like developer console run in user mode.

Mode of execution:

  • Trigger – System
  • Validation Rule – System
  • Auto Response Rule – System
  • Assignment Rule – System
  • Workflow Rule – System
  • Escalation Rule – System
  • All Types of calculation behind formula, Rollup Summary – System
  • Process Builder – System
  • Visual Workflow or flow – User
    • if flow is called from Process Builder – System
    • if flow is called from Workflow – System
    • if flow is called from Apex – (depends on with or without sharing of apex class)
    • if flow is called from Custom Button – System
    • if flow is embed in Visualforce – Depends on VFP context
    • if flow is called from REST API – System
  • Approval Process – System
  • Publisher Action – System
  • InvocableMethod
    • if this is called from flow – User
    • if this is called from Process Builder (does it depends on with or without sharing is specified on that Class) – System
    • if this is called from REST API – (depends on with or without sharing of the class)
  • Custom Button – System
  • Test method with System.runAs() – User
  • Test method without System.runAs() – System
  • Visualforce Page (StandardController) – User
  • Visualforce Page (StandardController with extension) – System
  • Visualforce Page (Custom Controller)
    • depends on with or without sharing of the controller
  • Visualforce Component – depends on Visualforce page where it is used
  • Macros – System
  • Annonymous Apex – User
  • Chatter in Apex – User
  • Email Service – User
  • All types of Jobs – System
  • Apex Webservices (SOAP API and REST API) – System (Consequently, the current user’s credentials are not used, and any user who has access to these methods can use their full power, regardless of permissions, field-level security, or sharing rules.)
### Payload in Google Services or APIs Usage and Meaning In the context of Google services or APIs, a payload refers to the actual data being transmitted within an API request or response body. This can include various types of information depending on the specific service or endpoint used. For instance, when interacting with Google's OAuth 2.0 system for authentication and authorization processes[^2], the payload often contains claims about the user or application making the request. These claims might be embedded inside JSON Web Tokens (JWTs), which consist of three parts: header, payload, and signature. The payload section carries statements regarding entities (typically referred to as "claims") such as issuer (`iss`), subject (`sub`), audience (`aud`), expiration time (`exp`), etc.[^2] When working with other Google APIs like those provided by Data Cloud configurations through Metadata API standards similar to Salesforce’s offerings[^1], payloads typically contain structured representations of metadata objects that one wishes to create, update, delete, or query. For example: ```json { "metadata": { "fullName": "CustomObject__c", "label": "Sample Custom Object", "pluralLabel": "Samples", "description": "A sample custom object created via Metadata API.", ... } } ``` This JSON snippet represents part of what could serve as a payload sent during calls made against endpoints supporting CRUD operations over metadata components managed under platforms adhering to Metadata API specifications comparable to those mentioned earlier concerning Salesforce but applicable also within certain aspects covered by Google's ecosystem.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值