News:

Wondering if this will always be free?  See why free is better.

Main Menu

Use board permissions in mod's action

Started by Avalanche91, December 25, 2014, 12:20:06 PM

Previous topic - Next topic

Avalanche91

Hey folks,

I have got a similar problem to the one in this topic. So I followed the guide about permissions here and I think I quite got the idea of how to use them. What I have now are board specific permissions, which work absolutely as expected for each board. The problem comes when I am trying to access my mod's action (aka /index.php?action=modName...). Despite having the ticks checked at the General Permissions tab, allowedTo always returns false when accessing my custom action.

So my question is, how to proceed in this situation? What am I missing, how do I make the connection between the permissions and my custom code? If I choose to set my permissions in the membergroup array located in ManagePermissions.php, then allowedTo works as expected, but unfortunately I lose the ability to disable my mod for some boards.

Cheers and Merry Christmas! :)

Arantor

Of course they will, you're *outside any board* so board permissions won't be loaded.

Question is: what board is it supposed to use to derive permissions from when you're not in a board?

dougiefresh

So how would we load the board's permissions from a custom action?  I'm curious because I've got a similar problem....

Arantor

You don't, basically. Board permissions are loaded automagically if either a topic or a board id is specified in the URL.

The question stands: if you're not inside a board, why load board permissions? There are a few specific cases (e.g. quick moderation) where you might be outside a board but in general...

dougiefresh

In my particular situation, I'm trying to use a board to manage our website's pages, aka display a topic like it was a normal webpage.  It makes website backup a bit easier, plus gives us the additional benefit of using SMF's editor to edit our pages  :P

Here's where I'm running in a problem: The first post has attachments in them and I can't show them inline within the post....  The board most topics are in is a private "admin and global mod"-only board, so no one can see it normally....  I really want to keep the attachments, but will be forced to use "conventional" images if I can't figure a way around this particular problem....


Arantor

There is no way around that without either 1) granting access to the board since attachment serving uses permissions implicitly (the URL is action=dlattch;...;topic=xyz), 2) munging the attachment serving to support in that board, or 3) not using attachments.

I hear a gallery solution might work for this :P

dougiefresh

Yuppers.... A gallery mod would be a good answer....  Was hoping for something else  :P  Thanks, Arantor!

Arantor

It just so happens that a new gallery is going through final testing before going on sale in the next day or two ;D

Advertisement: