{"id":650,"date":"2010-10-05T13:37:18","date_gmt":"2010-10-05T20:37:18","guid":{"rendered":"http:\/\/45.63.48.66\/?p=650"},"modified":"2019-05-02T14:53:44","modified_gmt":"2019-05-02T21:53:44","slug":"assigning-menu-suites-permission-automatically","status":"publish","type":"post","link":"https:\/\/gotcal.com\/index.php\/2010\/10\/assigning-menu-suites-permission-automatically\/","title":{"rendered":"Assigning Menu Suites permission Automatically &#8211; Implemented!"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-661\" title=\"menusuite\" src=\"\/wp-content\/uploads\/2010\/10\/menusuite.png\" alt=\"\" width=\"199\" height=\"146\">The other day i was reading Mayank&#8217;s new blog <a href=\"http:\/\/extremeengineering.net\">Extreme Engineering Network<\/a>. Especially his post about <a href=\"http:\/\/extremeengineers.net\/dynamics-nav\/21-assigning-menusuit-permission-dynamically-part1.html\">assigning menu suites automatically<\/a> was pretty neat. Well it could be, as it basically just gave you the information on _how_ you could do it. Looking at a lot of hex-editor information, i decided to give it a spin!<\/p>\n<p>Assigning Menu Suites to users is a painful job for any adminstrator, as you have to go into design of the menu suite, and then for each Menu you have to uncheck the box for users that should not have access. And setting up a new user, gives access to everything by default, so you have to go into each menu to unassign &#8211; lots of work!<\/p>\n<p><!--more-->Lets take the information to a POC &#8211; proof of concept. You can read all about the values in the blob field on Mayank&#8217;s blog, if you are interested in the details. But here is a quick video demonstration that shows you the POC i just did:<\/p>\n<ol>\n<li>First read the GUID and Description of the Menu&#8217;s in your current Menu Suites<\/li>\n<li>Assign Menus<\/li>\n<li>Update User Menu Level table<\/li>\n<\/ol>\n<p><object id=\"scPlayer\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"628\" height=\"452\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\"><param name=\"data\" value=\"http:\/\/content.screencast.com\/users\/SNielsen\/folders\/Jing\/media\/68ffdcbb-3ff9-4b5f-91bc-cc5ce77e6d76\/jingh264player.swf\"><param name=\"quality\" value=\"high\"><param name=\"bgcolor\" value=\"#FFFFFF\"><param name=\"flashVars\" value=\"thumb=http:\/\/content.screencast.com\/users\/SNielsen\/folders\/Jing\/media\/68ffdcbb-3ff9-4b5f-91bc-cc5ce77e6d76\/FirstFrame.jpg&amp;containerwidth=628&amp;containerheight=452&amp;content=http:\/\/content.screencast.com\/users\/SNielsen\/folders\/Jing\/media\/68ffdcbb-3ff9-4b5f-91bc-cc5ce77e6d76\/2010-10-05_1429.mp4&amp;blurover=false\"><param name=\"allowFullScreen\" value=\"true\"><param name=\"scale\" value=\"showall\"><param name=\"allowScriptAccess\" value=\"always\"><param name=\"base\" value=\"http:\/\/content.screencast.com\/users\/SNielsen\/folders\/Jing\/media\/68ffdcbb-3ff9-4b5f-91bc-cc5ce77e6d76\/\"><param name=\"src\" value=\"http:\/\/content.screencast.com\/users\/SNielsen\/folders\/Jing\/media\/68ffdcbb-3ff9-4b5f-91bc-cc5ce77e6d76\/jingh264player.swf\"><embed id=\"scPlayer\" type=\"application\/x-shockwave-flash\" width=\"628\" height=\"452\" src=\"http:\/\/content.screencast.com\/users\/SNielsen\/folders\/Jing\/media\/68ffdcbb-3ff9-4b5f-91bc-cc5ce77e6d76\/jingh264player.swf\" base=\"http:\/\/content.screencast.com\/users\/SNielsen\/folders\/Jing\/media\/68ffdcbb-3ff9-4b5f-91bc-cc5ce77e6d76\/\" allowscriptaccess=\"always\" scale=\"showall\" allowfullscreen=\"true\" flashvars=\"thumb=http:\/\/content.screencast.com\/users\/SNielsen\/folders\/Jing\/media\/68ffdcbb-3ff9-4b5f-91bc-cc5ce77e6d76\/FirstFrame.jpg&amp;containerwidth=628&amp;containerheight=452&amp;content=http:\/\/content.screencast.com\/users\/SNielsen\/folders\/Jing\/media\/68ffdcbb-3ff9-4b5f-91bc-cc5ce77e6d76\/2010-10-05_1429.mp4&amp;blurover=false\" bgcolor=\"#FFFFFF\" quality=\"high\" data=\"http:\/\/content.screencast.com\/users\/SNielsen\/folders\/Jing\/media\/68ffdcbb-3ff9-4b5f-91bc-cc5ce77e6d76\/jingh264player.swf\"><\/object><\/p>\n<p>It generates a binary file something like this:<\/p>\n<div id=\"attachment_669\" style=\"width: 469px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-669\" class=\"size-full wp-image-669 \" title=\"hex\" src=\"http:\/\/45.63.48.66\/wp-content\/uploads\/2010\/10\/hex.jpg\" alt=\"\" width=\"459\" height=\"349\" srcset=\"https:\/\/gotcal.com\/wp-content\/uploads\/2010\/10\/hex.jpg 459w, https:\/\/gotcal.com\/wp-content\/uploads\/2010\/10\/hex-300x228.jpg 300w\" sizes=\"auto, (max-width: 459px) 100vw, 459px\" \/><p id=\"caption-attachment-669\" class=\"wp-caption-text\">(C) Mayank - Extreme Engineers<\/p><\/div>\n<p>Since it is a POC, the code is really not release standard yet. But it is pretty simple. The blob field is written using a OutStream, there are some static content in it, and some size placeholders. Then all the GUID&#8217;s for the menu&#8217;s and finally their settings. This just gets imported back into the &#8220;User Menu Level&#8221; and voila. The POC only shows for the current user, but it will be expanded to have a full user setup, and groups, so you can assign users to menu groups etc.<\/p>\n<p>Any comments, suggestions for features &#8211; let me know. Not to forget kudos to Mayank for decoding the blob field :).<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>The other day i was reading Mayank&#8217;s new blog Extreme Engineering Network. Especially his post about assigning menu suites automatically was pretty neat. Well it could be, as it basically just gave you the information on _how_ you could do it. Looking at a lot of hex-editor information, i decided to give it a spin! [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[37,77,51,7,50,39,35,41,29],"class_list":["post-650","post","type-post","status-publish","format-standard","hentry","category-navision","tag-application","tag-navision","tag-menusuite","tag-objects","tag-poc","tag-programming","tag-system-table","tag-tools","tag-video"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts\/650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/comments?post=650"}],"version-history":[{"count":17,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts\/650\/revisions"}],"predecessor-version":[{"id":1030,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts\/650\/revisions\/1030"}],"wp:attachment":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/media?parent=650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/categories?post=650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/tags?post=650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}