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
Walter@AdicioWalter@Adicio 

How do i find out which objects a user can see? GroupMember object for example.

Im getting error ' no such column found ' for ' Id ' for example in a test method when i query the ' GroupMember ' object with runAs a customer portal user.

I assume this means a customer portal user cannot see that object, but how can I confirm that to make sure its not something else I am missing?

 

Osiris77706Osiris77706

User based security is in Setup > users > Profiles. Selecting the users profile type will bring up a window with all of the security settings for that type of user.

Pradeep_NavatarPradeep_Navatar

Tryout this sample code to get a workaround for GroupMember Object :

 

                ID usrId =  UserInfo.getUserId();

                String strGrpName = 'Z_' + con[0].AccountId;;

                Group grp= new Group();

                grp.Name = strGrpName;                   

                insert grp;

                GroupMember grpMr = new GroupMember();

                grpMr.UserOrGroupId = usrId;

                grpMr.GroupId = grp.id;

                insert grpMr; 

 

Hope this helps.