Security works with database