Custom topic permission checks


(Ryan Fox) #1

I’d like to be able to make calls to my site’s own API to determine if a user has permission to view a topic in a category that is otherwise not accessible to users.

It looks like I would have to modify TopicGuardian to do this. Is that the right way of going about this? Would I be able to make this as a plugin? (I haven’t been able to find any canonical information about writing plugins that isn’t 2 years old…)

Thanks.


(Jeff Atwood) #2

Why not use groups and group membership to do this, much easier.


(Ryan Fox) #3

I had considered groups, but I’d end up with something on the order of a thousand groups, and I’d need a category per group. That seems a little unwieldly.


(Ryan Fox) #4

Well, I am perhaps a terrible person for what I’ve done, but I managed to write a plugin to do what I want:

Any feedback is welcome.