If you are working within a template you should be able to use $access_type as documented at http://ez.no/doc/ez_publish/technical_manual/4_0/templates/the_pagelayout/variables_in_pagelayout
If you are working in php $GLOBALS['eZCurrentAccess'] shoud contain the same information.