We wanted to restrict read only users on Form ribbon click. First we tried to restrict using form type but interestingly not in all cases where form comes read-only, form type was matching to read only in CRM 2013. Hence,We used following unsupported script in all ribbon buttons which we did not
want to allow Read-only users to use:
//Show error for read-only users
if($(‘#titlefooter_statuscontrol’) != null)
if ($(‘#titlefooter_statuscontrol’).text() == “Read only”)
alert(“You do not have permission to peform this operation.”);
Hope it helps!