Moved helperfunctions from xyproto/permissions.