Optimized Reportal permission updating code