[转]Salesforce学习 权限管理

本文转自:https://cloud.tencent.com/developer/article/1579367

 

Salesforce 对于权限的管理是非常严谨的并且支持不同维度的权限控制。常用的有Profiles(简档)、Permissions Set(权限集)、Role Hierarchy(角色层级结构)和Organization-Wide(组织范围)这四项用来控制控制相应的权限。

一.Profiles

A.定义:Profiles是Salesforce为每个用户指定的标准配置文件,在创建用户时需指定(不同用户可使用同一Profile)。那么它究竟配置了什么样的内容呢,先来看一段官方定义:

  Profiles define how users access objects and data, and what they can do within the application.

这段话很明确的定义了用户通过Profile来获取对象的元数据(这里指具体字段和对象定义)和数据,并且可以规定了在不同的应用中可以做什么。展开来讲:

・用户可以看到哪些对象

・用户可以看到每个对象的哪些字段

・用户可以对哪些对象有什么权限(CRUD)

・用户可以看到哪些应用

・用户可以看到对象在不同的应用中的展现形式

B.Profiles做成,通过做成如下Profiles,对自定义object进行权限分配。

  1. From  Setup enter Profiles in the Quick Find box, and select Profiles.
  2. From the list of profiles, find Standard User.
  3. Click Clone
  4. For Profile Name, enter HR Recruiter.    ⇒招聘人员
  5. Click Save.
  6. While still on the HR Recruiter profile page, then click Edit.
  7. Scroll down to Custom Object Permissions and change the Basic Access for each object to reflect the table below, provided by the Ling.
  8. click Save
Profiles做成
对自定义object进行权限分配
自定义object权限分配成功

二.Permissions Set(权限集)

A.定义:Permission Sets将一系列权限展现了出来,可根据具体的需要选择具体的权限来赋予特定的用户权限。来看一下官方的标准定义:

A permission set is a collection of settings and permissions that give users access to various tools and functions. The settings and permissions in permission sets are also found in profiles, but permission sets extend users’ functional access without changing their profiles.

这段话说明Permission Set的权限范围和Profile是类似的,但是不同的是一个用户可以同时拥有N(>= 0)个Permission Sets而只能拥有一个Profile。

B.Permissions Set做成

  1. From Setup, enter Permission Sets in the Quick Find box, and select Permission Sets.
  2. Click New, and enter the details.
    • Field Label: Hiring Manager ⇒招聘经理
    • Description:
    • User License:Salesforce →什么是权限集许可证?

3.click Save

4.Click Assigned Apps in the Apps section, then click Edit.

5.Select Recruiting from the Available Apps list and click Add.

6.ClickSave.

7.Click the in the Assigned Apps list and select Object Settings.

8.Select Interviewers from the object list, and click Edit.

9.Select Visible under Tab Settings.

10.Select Read, Create, and Edit from the Object Permissions list.

11.Click Save.

C.Modify Field-Level Security

所有标准对象都有一组预定义的字段来捕获通用业务信息。 尽管无法删除它们,但字段级的安全性会使它们不可见。 字段级安全性控制配置文件或权限集可以查看和编辑的字段,覆盖任何限制较少的字段访问,并控制页面布局和搜索布局中的设置。

无论用户如何访问Salesforce,页面级安全性,相关列表,报表等等,都普遍强制执行字段级安全性。 因此,现场级别的安全性是保护敏感和机密信息的首选方法,例如HR招聘人员和招聘经理在其应用程序中使用的薪资范围。

  1. From Setup, click Object Manager, and select Position.
  2. Click Fields & Relationships, then select Salary Range(薪资范围).
  3. Click Set Field-Level Security.
  4. For HR Recruiter(招聘人员) and System Administrator, select Visible. (Ensure Visible is deselected for all other profiles.)
  5. Click Save.

D.继续设置set permissions.

  1. From Setup, enter Permission Sets in the Quick Find box, and select Permission Sets.
  2. Select Hiring Manager. ⇒招聘经理
  3. Click Object Settings in the Apps section.
  4. Click Positions from the list of object names, and click Edit.
  5. Under Field Permissions, select Read Access and Edit Access for Salary Range.
  6. Click Save

三.Orgnazation-Wide Defaults

A.相当于全局范围内,sObject的访问权限设置,一般分为:Private, Public Read Only, Public Read/Write

  • Private: 除了该条记录的拥有者,其他人无法访问(可通过其他的手段增加访问权限)。
  • Public Read Only: 除了该条记录的拥有者,其他人只有查看权限,没有修改权限(可通过其他手段增加修改权限)。
  • Public Read/Write: 所有的用户都可以访问该对象的所有记录。

B.例:Create Sharing Settings

  1. From Setup, enter Sharing Settings in the Quick Find box and select Sharing Settings.
  2. Click Edit in the Organization-Wide Defaults section.
  3. Select Private for the Candidate object.
  4. Select Private for the Interviewer object.
  5. Select Private for the Job Application object.
  6. Select Public Read Only for the Job Posting Site object.
  7. Select Private for the Position object.
  8. Click Save.

四.Role Hierarchy(角色层级结构)

角色层级结构是组织的一个定义范围,规定了不同的职位的从属关系。以下是官方定义:

Salesforce offers a user role hierarchy that you can use with sharing settings to determine the levels of access that users have to your Salesforce org’s data.

在私有或者混合模型中,如果在organization-wide defaults设置某个对象为Private,那么对象的记录只有拥有者可以查看。但是,role hierarchy可以让该条记录拥有者的上司有权限访问该条记录。

前提:Case在Organization-wide Defaults中被设为Private.

如图片中所说,如果US Sales Rep为Case A的拥有者,则US Sales Director,VP of Global Sales以及CEO都拥有访问Case A的权限。

注意,这里的权限继承是单向的。例如:US Sales Director为Case B的拥有者,那么VP Sales Director和CEO拥有Case B的访问权限,而US Sales Rep没有。

五.Sharing Rules

除了设置全局范围内默认的权限外,还可针对某个Object,自定义设置Sharing Rules以满足业务需求。

  1. From Setup, enter Sharing Settings in the Quick Find box and select Sharing Settings.
  2. Click New in the Sharing Rules section.

3.Rule Type

3.1 Based on record owner

当记录的拥有者的条件:Public groups == Account Share-BALTI 为真时,将该条记录分享给NGCC-CC Site Manager这个Role以及属于该Role下的所有用户。

注意:这里拥有者和被分享者有多种选择,可以是Group(用户组), Role(某个用户或某类用户),Roles, Internal and Portal Subordinates(某个用户及该用户下属所有用户)等,这些都可以自定义创建。

3.2 Based on criteria

当满足该条规则时,便将该条记录分享给NGCC-CC Site Manager这个Role以及属于该Role下的所有用户。

六.Teams

创建一个team,在其中添加多个用户,然后将记录分享给整个team成员,对于Salesfroce来讲,目前只有两个标准对象拥有team概念:Account, Case.

1. Enable Account Team

2.选择在哪些Page layout中可以看到Team,并将其添加到用户的自定义相关列表中,点击save。

3.【Setup】-->【Object Manager】-->【Account】-->【Page Layouts】-->【***】(自定义page layout)

选择Related Lists,在右侧找到Account Team后,将其拖至下方,点击Save按钮--> Yes,如下图所示。

4.点击九宫格,在All Items下面选择Account,进入Account导航页面。

七.总结

原创声明,本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

posted on 2022-08-09 21:17  freeliver54  阅读(276)  评论(0编辑  收藏  举报

导航