Where did you put that code? profileController_render_before?
Since profile/notifications always only shows the notifications for the session user, you do not have to do anything there:
public function profileController_render_before($sender, $args) {
// Use the longer if clause if you find
// more methods where your restriction causes problems.
// if (in_array(strtolower(__FUNCTION__), array('notifications', '...'))) {
if (strtolower(__FUNCTION__) == 'notifications') {
return;
}
...
Thanks you all for your hand holding. My problem is now fully solved with the aid of the plugin. I wish I started this discussion as a question in which case I could have marked it a "solved'.
I uploaded the plugin because I hope the use of Vanilla in corporate environment will expand (open source is gaining more support in the enterprise).
Comments
Where did you put that code? profileController_render_before?
Since profile/notifications always only shows the notifications for the session user, you do not have to do anything there:
implicit
$UserID = $Sender->User->UserID;
If ($UserID < 1) {
return;
}
although explict could conceivably be safer.
also I prefer the exception here,
http://vanillaforums.org/discussion/comment/232558/#Comment_232558
rather than permissionexception
since it doesn't explicitly have a role in message. to each his own.
I hope this answers your question
"Should users be able to see other users through YAGA badges?"
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Thanks you all for your hand holding. My problem is now fully solved with the aid of the plugin. I wish I started this discussion as a question in which case I could have marked it a "solved'.
I uploaded the plugin because I hope the use of Vanilla in corporate environment will expand (open source is gaining more support in the enterprise).