Commit e10183e9 authored by Nigel McNie's avatar Nigel McNie
Browse files

Add a message to an AccessDeniedException

parent f8a174f2
......@@ -88,6 +88,7 @@ $string['accessdeniedexception'] = 'You do not have access to view this page';
$string['viewnotfoundexceptiontitle'] = 'View not found';
$string['viewnotfoundexceptionmessage'] = 'You tried to access a view that didn\'t exist!';
$string['viewnotfound'] = 'View with id %s not found';
$string['youcannotviewthisusersprofile'] = 'You cannot view this user\'s profile';
$string['artefactnotfoundmaybedeleted'] = "Artefact with id %s not found (maybe it has been deleted already?)";
$string['artefactnotfound'] = 'Artefact with id %s not found';
......@@ -62,7 +62,7 @@ $userobj->find_by_id($userid);
$view = $userobj->get_profile_view();
# access will either be logged in (always) or public as well
if (!$view || !can_view_view($view->get('id'))) {
throw new AccessDeniedException();
throw new AccessDeniedException(get_string('youcannotviewthisusersprofile'));
$name = display_name($user);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment