Redirect back to the album view if the user doesn't have edit access
This commit is contained in:
parent
90946341ba
commit
b75d41dfba
|
@ -21,7 +21,11 @@ class Captionator_Controller extends Controller {
|
||||||
function dialog($album_id) {
|
function dialog($album_id) {
|
||||||
$album = ORM::factory("item", $album_id);
|
$album = ORM::factory("item", $album_id);
|
||||||
access::required("view", $album);
|
access::required("view", $album);
|
||||||
access::required("edit", $album);
|
|
||||||
|
if (!access::can("edit", $album)) {
|
||||||
|
// The user can't edit; perhaps they just logged out?
|
||||||
|
url::redirect($album->abs_url());
|
||||||
|
}
|
||||||
|
|
||||||
$v = new Theme_View("page.html", "collection", "captionator");
|
$v = new Theme_View("page.html", "collection", "captionator");
|
||||||
$v->content = new View("captionator_dialog.html");
|
$v->content = new View("captionator_dialog.html");
|
||||||
|
|
Reference in New Issue
Block a user