adding permissions to functions