rebuild portal authorization. Fix init bug