Major revision to permission checking system