Guests see "Post event" button even if they can't send topics/posts

Started by Adrek, July 26, 2012, 12:23:34 PM

Previous topic - Next topic

Adrek

Well this is more cosmetic 'bug'.

Clean SMF 2.0.2.
Calendar enabled, added permission for guests: Create events in the calendar

Guests see button, but when they try to add event they see: Sorry, you cannot post new topics in this board.

So I think that would be nice to hide it in this situation
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

kat

If posting an event creates a post in a topic, the permission to start topics, in that board, has to be given, too, I'd imagine.

Adrek

yes, and if guests cannot post topics they shouldn't see button
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one


emanuele

The problem is probably avoid yet another query just to hide a button.

For example you can have by default the permission to post new topics disabled for a group, but then you can create a new profile where the same group has permission to create new topics and you assign this profile to a board.
Result: you should be able to post events, but to verify that SMF has to do a query to check it out (in particular it has to use getBoardList to find out if there is any board the user can post into).

So probably the reason behind this "bug" is that do a query just to hide a menu is a bit of a waste.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Arantor

boardsAllowedTo() doesn't use getBoardList, and it'd tell you everything with only one quite cheap query ;)
Holder of controversial views, all of which my own.


emanuele

* emanuele *was* good at multitasking, but now age advancing... :P


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.


Advertisement: