Message from discussion
Auth->deny fails after Auth->allow('*')
Received: by 10.66.79.6 with SMTP id f6mr2527905pax.3.1352343563215;
Wed, 07 Nov 2012 18:59:23 -0800 (PST)
X-BeenThere: cake-php@googlegroups.com
Received: by 10.68.236.33 with SMTP id ur1ls9214171pbc.2.gmail; Wed, 07 Nov
2012 18:59:01 -0800 (PST)
Received: by 10.68.234.41 with SMTP id ub9mr2299009pbc.11.1352343541923;
Wed, 07 Nov 2012 18:59:01 -0800 (PST)
Date: Wed, 7 Nov 2012 18:59:01 -0800 (PST)
From: Sam <lightai...@gmail.com>
To: cake-php@googlegroups.com
Message-Id: <eba78326-98eb-4cae-a866-468baaf67d78@googlegroups.com>
In-Reply-To: <765EC1F6-B90B-4256-A047-C5E2B053794D@kende.com>
References: <99448131-994f-476e-9553-03d42e83064d@googlegroups.com> <468ecde7-c733-4057-a799-236171649265@googlegroups.com> <23886ac4-7198-4f1d-acea-b66aa22e75b5@googlegroups.com>
<765EC1F6-B90B-4256-A047-C5E2B053794D@kende.com>
Subject: Re: Auth->deny fails after Auth->allow('*')
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_1822_28032305.1352343541236"
------=_Part_1822_28032305.1352343541236
Content-Type: multipart/alternative;
boundary="----=_Part_1823_1179833.1352343541236"
------=_Part_1823_1179833.1352343541236
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Thank you very much. I will try it out.
On Wednesday, November 7, 2012 4:24:17 PM UTC+8, Andras Kende wrote:
>
>
> Try: $this->Auth->allow(); its changed in cake 2.2 ...
>
> Andras Kende
> http://www.kende.com
>
> On Nov 7, 2012, at 12:10 AM, Sam <light...@gmail.com <javascript:>> wrote:
>
> Sorry for missing out the version number. I am using CakePHP ver2.2.1
>
> On Sunday, November 4, 2012 9:30:17 PM UTC+8, euromark wrote:
>>
>> you do realize that without always(!) noting the cake version you are
>> working on, that no one will be able to help you here?
>> the way it works changed quite a bit over the versions. one could only
>> guess right now.
>>
>>
>> Am Sonntag, 4. November 2012 01:16:57 UTC+1 schrieb Sam:
>>>
>>> Dear CakePHP experts,
>>>
>>> I want to have lenient authorization for my CakePHP app allowing most
>>> actions and denying only a few. I have this below in AppController class;
>>>
>>> public function beforeFilter()
>>> {
>>> $this->Auth->allow('*');
>>> $this->Auth->deny('delete', 'edit','add');
>>> }
>>>
>>> For some reason, everything is allowed. Can someone with more experience
>>> give me some hint why deny is not working?
>>>
>>> THank you for your help.
>>>
>>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake...@googlegroups.com<javascript:>
> .
> To unsubscribe from this group, send email to
> cake-php+u...@googlegroups.com <javascript:>.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>
>
>
------=_Part_1823_1179833.1352343541236
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Thank you very much. I will try it out.<br><br>On Wednesday, November 7, 20=
12 4:24:17 PM UTC+8, Andras Kende wrote:<blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-le=
ft: 1ex;"><div style=3D"word-wrap:break-word"><div><br></div><div>Try: $thi=
s->Auth->allow(); its changed in cake 2.2 ...</div><div><br></d=
iv><div>Andras Kende</div><div><a href=3D"http://www.kende.com" target=3D"_=
blank">http://www.kende.com</a></div><br><div><div>On Nov 7, 2012, at 12:10=
AM, Sam <<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailt=
o=3D"uimEEFGg7t0J">light...@gmail.com</a>> wrote:</div><br><blockquote t=
ype=3D"cite">Sorry for missing out the version number. I am using CakePHP v=
er2.2.1<br><br>On Sunday, November 4, 2012 9:30:17 PM UTC+8, euromark wrote=
:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bord=
er-left:1px #ccc solid;padding-left:1ex">you do realize that without always=
(!) noting the cake version you are working on, that no one will be able to=
help you here?<div>the way it works changed quite a bit over the versions.=
one could only guess right now.</div><div><br></div><div><br>Am Sonnt=
ag, 4. November 2012 01:16:57 UTC+1 schrieb Sam:<blockquote class=3D"gmail_=
quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;paddi=
ng-left:1ex">Dear CakePHP experts,<div><br></div><div>I want to have lenien=
t authorization for my CakePHP app allowing most actions and denying only a=
few. I have this below in AppController class;</div><div><br></div><d=
iv><div><span style=3D"white-space:pre">=09</span>public function beforeFil=
ter()</div><div><span style=3D"white-space:pre">=09</span>{<span style=3D"w=
hite-space:pre">=09=09</span><span style=3D"white-space:pre">=09=09=09</spa=
n></div><div><span style=3D"white-space:pre">=09=09=09</span>$this->Auth=
->allow('*');</div><div><span style=3D"white-space:pre">=09=09=09</span>=
$this->Auth->deny('delete', 'edit','add');<span style=3D"white-space:=
pre">=09=09=09</span></div><div><span style=3D"white-space:pre">=09</span>}=
<span style=3D"white-space:pre">=09</span><br></div></div><div><br></div><d=
iv>For some reason, everything is allowed. Can someone with more experience=
give me some hint why deny is not working?</div><div><br></div><div>THank =
you for your help.</div></blockquote></div></blockquote><div><br></div>
-- <br>
Like Us on FaceBook <a href=3D"https://www.facebook.com/CakePHP" target=3D"=
_blank">https://www.facebook.com/<wbr>CakePHP</a><br>
Find us on Twitter <a href=3D"http://twitter.com/CakePHP" target=3D"_blank"=
>http://twitter.com/CakePHP</a><br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
CakePHP" group.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"uimEEFGg7t0J">cake...@googlegroups.com</a>.<br=
>
To unsubscribe from this group, send email to <a href=3D"javascript:" targe=
t=3D"_blank" gdf-obfuscated-mailto=3D"uimEEFGg7t0J">cake-php+u...@<wbr>goog=
legroups.com</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/group/cake-php?hl=
=3Den" target=3D"_blank">http://groups.google.com/<wbr>group/cake-php?hl=3D=
en</a>.<br>
<br>
<br>
</blockquote></div><br></div></blockquote>
------=_Part_1823_1179833.1352343541236--
------=_Part_1822_28032305.1352343541236--