I have a JavaScript which I use to hide or show a button based on the logged in user.
Button:
<a id="customAddNew" href="/ibs/_layouts/listform.aspx?PageType=8&ListId={CED7A37E-B1B4-46DD-B5C6-9232195D7E16}&RootFolder=" target="_self" style="display: none;">Submit Work Order</a>
Script:
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("initiate");
function initiate(){
var email = $().SPServices.SPGetCurrentUser({
fieldName: "EMail",
debug: false
});
var trimmedEmail = email.split("@");
var newButton = document.getElementById("customAddNew");
if (trimmedEmail[1] == "napacanada.com"){
//Is NAPA User, which can't Add New Items
alert("napa user");
//newButton.style.display = "none";
$("[id$=customAddNew]").setAttr("display","none");
}else{
//Is City User, can Add New Items
alert("none napa user"
//newButton.style.dispaly = "block";
$("[id$=customAddNew]").setAttr("display","block");
}
}
</script>
I've placed the script in a CEWP and linked to the js file.