Changed to use secure_permissions module