{"id":502,"date":"2024-11-07T13:35:53","date_gmt":"2024-11-07T13:35:53","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=502"},"modified":"2025-08-06T13:09:00","modified_gmt":"2025-08-06T12:09:00","slug":"mwnci-groups-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-groups-function\/","title":{"rendered":"Mwnci groups() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>groups<strong>(<em>[string]<\/em>)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>groups()<\/i> function returns a hash of group names and associated Gid\u2019s that a given user belongs to.<br \/>\nAn empty hash is returned if there is no data<\/p>\n<h2>Example<\/h2>\n<pre>include(\"grp\")\r\nprintln(groups(\"root\"))\r\nprintln(groups())\r\n\r\n{\"root\": 0}\r\n{\"plugdev\": 46, \"adm\": 4, \"input\": 102, \"users\": 100}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax groups([string]) Description The groups() function returns a hash of group names and associated Gid\u2019s that a given user belongs to. An empty hash is returned if there is no data Example include(&#8220;grp&#8221;) println(groups(&#8220;root&#8221;)) println(groups()) {&#8220;root&#8221;: 0} {&#8220;plugdev&#8221;: 46, &#8220;adm&#8221;: 4, &#8220;input&#8221;: 102, &#8220;users&#8221;: 100}<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-502","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=502"}],"version-history":[{"count":5,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/502\/revisions"}],"predecessor-version":[{"id":1191,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/502\/revisions\/1191"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}