One option is to display your Edit Button within a TemplateField and call a small helper function in the code-behind like so:
ASPX
<asp:linkbutton id="btnEdit" runat="server" commandname="Edit" text="Edit" visible='<%# AuthorizedToEdit() %>' />
CODE-BEHIND
protected bool AuthorizedToEdit()
{
return // some boolean expression here to indicate permission to edit
}
Thanks, Ed
Microsoft MVP - ASP/ASP.NET
protected void Post_Answered(object sender, EventArgs e) { if (this.MarkAsAnswered != null) { this.MarkAsAnswered(this, EventArgs.Empty); } }