/**
* Checks for readonly permissions
*
* @param kEvent $event
*/
function OnUpdate(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY',
1)) {
$event->status = erSTOP;
return;
}
parent::OnUpdate($event);
}
Should work well.
DA.
DA.
--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.
Yes, you are right here!
I just found a bad example where READONLY check was done, but looked
at kDBEventHandler and knew it was parent and probably we should added
there but thought it was too broad and decided to do it in a child
class.
Anyway will be attaching a new patch shortly.
DA
On Jan 20, 2:30 am, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> You've forgot to mention where you can actually see the effects of that
> patch, but I'll do it. ContentEventHander::OnUpdate method is used to save
> content block translation/contents.
>
> If you'll do a little research in 'SYSTEM_ACCESS.READONLY' permission
> checking, that you will notice, that most of them are checked directly in
> kDBEventHandler class. But it looks like, that OnUpdate event was forgotten
> during session, where 'SYSTEM_ACCESS.READONLY' permission checks were
> placed. So the correct way is to place this code:
>
> if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
> $event->status = erFAIL;
> return;
>
> }
>
> at the start of kDBEventHandler::OnUpdate event. Also notice, that it sets
> status to erFAIL, instead of erSTOP. See more about event statuses athttp://guide.in-portal.org/eng/index.php/K4:%D0%9A%D0%BE%D0%BD%D1%81%....
>
> On Wed, Jan 20, 2010 at 4:26 AM, Dmitry Andrejev <dandre...@gmail.com>wrote:
>
>
>
>
>
> > Patch attached
>
> > On Tue, Jan 19, 2010 at 7:50 PM, Dmitry A. <dandre...@gmail.com> wrote:
>
> >> Forgot to add it's for In-Portal 5.0.2.
>
> >> DA.
>
> >> On Jan 19, 7:35 pm, "Dmitry A." <dandre...@gmail.com> wrote:
> >> > I think there is a small bug we need to check for READONLY
> >> > permission in Content Even Handler:
>
> >> > /**
> >> > * Checks for readonly permissions
> >> > *
> >> > * @param kEvent $event
> >> > */
> >> > function OnUpdate(&$event)
> >> > {
> >> > if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY',
> >> > 1)) {
> >> > $event->status = erSTOP;
> >> > return;
> >> > }
> >> > parent::OnUpdate($event);
>
> >> > }
>
> >> > Should work well.
>
> >> > DA.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "In-Portal Bugs Team" group.
> >> To post to this group, send email to in-port...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> in-portal-bug...@googlegroups.com<in-portal-bugs%2Bunsubscribe@go oglegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/in-portal-bugs?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "In-Portal Bugs Team" group.
> > To post to this group, send email to in-port...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > in-portal-bug...@googlegroups.com<in-portal-bugs%2Bunsubscribe@go oglegroups.com>
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.