You need to sign in to do that
Don't have an account?
sfdc development hints
hi
i have a command link called as delete in my vf page , for which i need to have the delete link visible only for system admin and not for other users, how do i restrict that
Hi,
Try the below code snippet as reference.
=====VF=======
<apex:page controller="getProfileuser" >
<apex:form >
Submit Here
<apex:commandLink value="Delete" rendered="{!bool}"/>
</apex:form>
</apex:page>
=======Apex Controller=======
public class getProfileuser {
public boolean bool { get; set; }
public getProfileuser()
{
Profile ProfileName = [select Name from profile where id = :userinfo.getProfileId()];
system.debug('_______ProfileName ____'+ProfileName );
if(ProfileName.Name=='System Administrator')
{
bool=true;
}
else
{
bool=false;
}
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.