MT::App::CMS::cms_view_permission_filter.$type
This callback is invoked when a user is attempting to view an object of a designated type (as specified by $type) from within the Movable Type application. The intent of this callback is to give plugins the opportunity to revoke the current user's permission to view the correlated object.
Input Parameters
- $cb - a reference to the current
MT::Callbackobject handling this event. - $app - a reference to the
MT::App::CMSobject processing the request. - $id - the ID of the object, if it already exists, or "undef" if it is a new object with this request.
- $obj_promise - a promise for the object itself. You can use
$obj_promise->forceto get ahold of the object, if you need it, but typically you won't need it.
Return Value
A boolean (true/false) value. Returning false will revoke the current user's ability to view the corresponding object.
Example Handler
sub handler {
my ($cb, $app, $id, $obj_promise) = @_;
if ($id % 2 == 0) { return 0; }
return 1;
}
This page is part of the Events and Callbacks in Movable Type
- Previous MT::App::CMS::cms_pre_save.$type
Leave a note
Have a question? Please use the MT Forums. Notes submitted on documentation should pertain to tips & hints regarding documentation. Your note may be removed once its contents have been integrated into the body of the page.