The implementation seems clear to me. You just need to specify a JavaScript variable on the server side that will describe which editing mode the user can use. You can even allow editing a user, but not another.
If you do not want to allow any form editing for some use, you can check the value of the corresponding variable, and the call to navGrid depends on the value:
if (my.formEditing) { $("#list").jqGrid('navGrid', '#pager', ....); }
or you can use
if (my.formEditingOn) { $("#list").jqGrid('navGrid', '#pager', {edit: my.formEditOn, add: my.formAddOn, add: my.formDelOn}, ....); }
If you use the trick described in the answer (see demo ) you can call "navGrid" and create all the buttons of the navigator, but only the visible visible buttons depend on the user rights.
In case of using inline editing you can use something like
onSelectRow: function (id) { if (!my.inlineEditing) { return; }
The initialization of the my variable may vary depending on the technology you are using on the server side. In the simplest variable, my can be defined as global on the page so that it can be defined at the top level. In the case of ASP.NET MVC, the code might look like this:
<%@ Page ... ... <asp:Content ID="Content3" ContentPlaceHolderID="head" runat="server"> <%-- first include script which defines global my object based on the user rights --%> <script type="text/javascript"> </script> <%-- now include the main script which uses jqGrid --%> <script type="text/javascript" src="<%= Url.Content(scriptPath) %>"></script>
source share