boolean addPolicy ( String sec , String ptype , List < String > rule ) { boolean ruleAdded = model . addPolicy ( sec , ptype , rule ) ; if ( ! ruleAdded ) { return false ; } if ( adapter != null && autoSave ) { try { adapter . addPolicy ( sec , ptype , rule ) ; } catch ( Error e ) { if ( ! e . getMessage ( ) . equals ( "not implemented" ) ) { throw e ; } } if ( watcher != null ) { // error intentionally ignored watcher . update ( ) ; } } return true ; }
addPolicy adds a rule to the current policy .