notification method is_available() (possible) bug

Discuss general development subjects that are not specific to a particular version like the versioning control system we use or other infrastructure.
Post Reply
Senky
Extension Customisations
Extension Customisations
Posts: 309
Joined: Thu Jul 16, 2009 4:41 pm

notification method is_available() (possible) bug

Post by Senky » Sat Jan 12, 2019 10:09 am

Hi everyone,
I want to discuss usage of is_available() in notification methods. So far there is no method that uses auth class. So everything works normally, but I have added a new method which now looks like this:

Code: Select all

...
public function is_available()
{
	return $this->auth->acl_get('...');
}
...
So I wondered why it didn't send the notification sometimes and it turned out that is_available() is used in \phpbb\notification\manager::get_default_methods(). This method is used in almost all notification types to decide what notification methods will be used to notify users.

Now the problem is, that get_default_methods() uses sender's auth to decide what methods should receiver get. Therefore if sender is not allowed to use the method, receiver won't get the notification.

Can anyone tell me if this is really desired state and I should not be using auth in is_available() or it's a bug but no one cared yet because no one used auth yet?

Post Reply