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
Ankit Gupta SFDCLearnerAnkit Gupta SFDCLearner 

Queston related to Role and Profile

Hello Friends, I am learning SFDC by developer forum.
I have a query regards Roles and Profiles.
Case1:
Suppose we have a LogedIn User "U1", having a profile "P1" and one custom sObject "obj__c"
* U1 haven't a Role. (No role is assigned to User U1)
* P1 have the permissions of Create, Delete, Edit and View for sObject obj__c
* OWD Settings for "obj__c" is Private with Unchecked Grant Access CheckBox.
So for above case only user U1 will be able to view the records. Yes / No

Case 2:
 For this case please see the attached Image first.

User-added image
so, now system administrator assign a Role "Associate" to a user U1, and assigned Role Associate  have all Roles in a Hirarchey. And Hopefully all assigned role's user have a different profile. User U1 have old Profile with same permissions, and OWD settings are Public Read Only now.
So in this case who will be able to view the records after creation by user U1, Will any one will be able to edit the records or not.
Steven NsubugaSteven Nsubuga
Case 1: Yes* System Administrator and anyone else whose profile has View All Data permission can also see the record.
Case 2: System Administrator and anyone else whose profile has Modify All Data permission can modify the record. Team Leader, Project Leader and Project Manager can only view the records.
I am a bit uncertain about my answer for Case 2.
Ankit Gupta SFDCLearnerAnkit Gupta SFDCLearner
Thanks a lot Steven Nsubuga