[Question] Purpose of LoadPolicy() and SavePolicy() methods
Googlom opened this issue · 1 comments
Googlom commented
Hi. I wonder what is the purpose of LoadPolicy()
and SavePolicy()
methods here in mongo adapter if Enforce()
reads directry from db and there is AddPolicy()
method which writes directly to db?
hsluoyz commented
@Googlom AutoSave
is an optional feature and when it's unavailable, an adapter has to use LoadPolicy()
and SavePolicy()
and interact with DB.
When you use an adapter that supports AutoSave
, you will only use LoadPolicy()
to load all rules first, then use AddPolicy()
or RemovePolicy()
to modify rules. SavePolicy()
is usually not used.