{"id":669,"date":"2014-02-07T13:45:48","date_gmt":"2014-02-07T13:45:48","guid":{"rendered":"http:\/\/thomas.w-p.me.uk\/blog\/?p=669"},"modified":"2014-02-07T17:25:38","modified_gmt":"2014-02-07T17:25:38","slug":"more-cakephp-notes","status":"publish","type":"post","link":"https:\/\/thomas.w-p.me.uk\/blog\/2014\/02\/more-cakephp-notes\/","title":{"rendered":"More CakePHP notes"},"content":{"rendered":"<p>Get the authentication details in a view. Permission based so in a user with low rights you need to specifically identify the property you want<\/p>\n<pre class=\"lang:default decode:true crayon-selected\">&lt;?php debug($this-&gt;Session-&gt;read('Auth.User')); \/\/ works with power user ?&gt;<\/pre>\n<pre>&lt;?php debug($this-&gt;Session-&gt;read('Auth.User.username')); \/\/ works everywhere ?&gt;<\/pre>\n<p>If you want to make a banned view (under ACL) accessible, in the Controller use Auth-&gt;Allow:<\/p>\n<pre class=\"lang:default mark:4 decode:true\">public function beforeFilter() {\r\n\tparent::beforeFilter();\r\n\t\/\/ this makes the index visible to everyone\r\n\t$this-&gt;Auth-&gt;allow('index', 'view');\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Get the authentication details in a view. Permission based so in a user with low rights you need to specifically identify the property you want &lt;?php debug($this-&gt;Session-&gt;read(&#8216;Auth.User&#8217;)); \/\/ works with power user ?&gt; &lt;?php debug($this-&gt;Session-&gt;read(&#8216;Auth.User.username&#8217;)); \/\/ works everywhere ?&gt; If you want to make a banned view (under ACL) accessible, in the Controller use Auth-&gt;Allow: &hellip; <a href=\"https:\/\/thomas.w-p.me.uk\/blog\/2014\/02\/more-cakephp-notes\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">More CakePHP notes<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[67],"class_list":["post-669","post","type-post","status-publish","format-standard","hentry","category-geekiness","tag-cakephp"],"_links":{"self":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/comments?post=669"}],"version-history":[{"count":6,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/669\/revisions"}],"predecessor-version":[{"id":674,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/posts\/669\/revisions\/674"}],"wp:attachment":[{"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/media?parent=669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/categories?post=669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thomas.w-p.me.uk\/blog\/wp-json\/wp\/v2\/tags?post=669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}