+ Start a Discussion

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?



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.


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.