Added checkPermissions method