As my question implies what i want, i used google to search through the web to get correct answer though simple about how to verify if current logged in user is super user or not in both joomla 2.5 and 3 versions. I found these codes -
$user = JFactory::getUser();
$isroot = $user->get('isRoot');
if $isroot is 1 then the user is super user. Does it appropriate and error free all the ways??