You need to sign in to do that
Don't have an account?

How to identify is loged in user is a community user or portal user.
Hi,
I have created a manage package, in which I am displaying chatter feeds for login user. I want this feeds need to be displayed for only community user not for portal user, so i want to hide the component for portal users. So how can I identify is the loged in user is a community user or portal user.
Thanks
Anu
Hi Anu,
On user you have a checkbox field called 'IsPortalEnabled' if user is community or portal user than this checkbox is true, So you check for this field.
Thanks
Hit the Kudos button (star) and Mark as solution if it post helps you
Thanks for your reply. But i want to diffrencite is the log in use is community or portal. If portal i want to hide a component and for community user i want ot display the component with chatter feeds.
Hi Anu
You can use getUserType method to find type of logged in user
String us = userinfo.getUserType();
Description The category of user license. Each UserType is associated with one or more UserLicense records. Each UserLicense is associated with one or more profiles. In API version 10.0 and later, valid values include:
thanks, but i want to know whether the user have loged as portal user or community user. I want to identity which how he has login.
Whether logged in user is Community user or Portal user.
Profile userProfile = [Select Name from Profile where Id =: userinfo.getProfileid() ];
String pname = userProfile.name;
System.debug(pname);
if(pname == 'Customer Community User') {
//to do code
}
else if (pname == 'Customer Portal User'){
//to do code
}
Thanks,
If this helps, marks it as solution.