Probably the easiest way is to create an extension that is fired by these hooks:
https://docs.expressionengine.com/latest/development/extension-hooks/cp/css.html https://docs.expressionengine.com/latest/development/extension-hooks/cp/javascript.html
Then you can just inject JavaScript and CSS in to your Control Panel.
Here's an example of the two methods you could fire in your extension:
function add_cp_tweaks_css()
{
$css .= file_get_contents(PATH_THIRD."my_cp_extension/css/cp.css");
return ee()->extensions->last_call . "\n" . $css;
}
function add_cp_tweaks_js()
{
$js .= file_get_contents(PATH_THIRD."my_cp_extension/js/cp.js");;
return ee()->extensions->last_call . "\n" . $js;
}
Then in your CSS file and JavaScript file, just manipulate the DOM as necessary.
// cp.css
.my-message {
font-weight: bold;
}
// cp.js
$(".t-0").prepend('<div class="my-message">You are not allowed to add pictures. Contact an admin.</div>');
Based on your use case, you'll need to probably want to add checks to make sure you only insert your JavaScript and CSS on Entry pages, and also want to check what user group the member is so you don't add the message to SuperAdmins or those who are allowed. So something like this:
$user_group_to_show_message = 10;
$referer = (array_key_exists('HTTP_REFERER',$_SERVER) ? $_SERVER['HTTP_REFERER'] : '');
// IfCheck if we're on thea Editpublish page, get Entry ID from referrer
preg_match('/.*publish\/edit\/entry\/(\d+).*create|edit\/', $referer, $entryentry);
// If we're on the Create page, get Channel ID from referrer
preg_match('/.*publish\/create\\/(\d+[0-9]+).*/', $referer, $channel$match);
if (array_key_exists(1,$entry)
&& is_numeric($entry[1])
&& ee()->session->userdata('group_id') === $user_group_to_show_message) {
// We are on a Edit page, with the right user group to warn, go ahead and add CSS/JS
}
if (array_key_exists(12,$channel$match)
&& is_numeric($channel[1]$match[2])
&& ee()->session->userdata('group_id') === $user_group_to_show_message) {
// We are on a CreatePublish page, with the right user group to warn, go ahead and add CSS/JS
}