Moved permissions setting to other function [ADS-1]