function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Starz26Starz26 

OWD Read access but no access to Object

Just want to make sure I have this correct........

 

If I have a custom object

 

OWD set to Public Read

Profile Object Access Set to ALL UNCHECKED

 

 

1. The user WILL NOT be able to access the object to view records, VF pages will NOT display the records, API access will NOT return results for the user to view correct?

 

2. Classes WILL be able to look at the records to get value from it and use elsewhere or store in a value to display?

 

Just trying to see what effect it would have to set the OWD to Public Read and profile to basically NO access

IspitaIspita

Hi,

Well you need to also check rights of the user w.r.t. the Object in the profile under

Custom object rights -> Data Admistration-> If "View all" is not checked then user will not be able to see records whose owner is someone else ~ do check this setting too.

 

Hope this helps....

Aravind SriramAravind Sriram

The user cannot access any records either from UI or from code. Thats it. As per my knowledge,Profile is most restrictive settings than anything.

 

Thanks,

Aravind

Starz26Starz26

Aravind Sriram wrote:

The user cannot access any records either from UI or from code. Thats it. As per my knowledge,Profile is most restrictive settings than anything.

 

Thanks,

Aravind


 

Actually, the profile is not restrictive in terms of the data access. It is restrictive in terms of interacting with the data via the UI etc..

 

For example.

 

1. Object has Public Read

2. User has CRUD no access

 

In apex classes that query the data in the Object, for that user it will return ALL records and can display the values.

 

The general Salesforce montra when thinking about sharing is to follow the rule:

 

OWD is the only way to restrict access, everything else adds additional access.

 

If even ONE user should not see the record(s), the OWD must be set to private

 

This means that in terms of DATA, the only way to restrict a user from accessing the data in any way is to set the OWD to private. Otherwise Apex code could return data from records to which the user would not see in the UI but has access to via code.