Fixed sec not having department access

Fixes #2752

I'd suggest instamerging this.

Security department code is a mess, refactoring it is going on my todo list, but since this is an urgent fix this will have to do for now.

Please test stuff relevant to any code you touch.