MCPcopy Index your code
hub / github.com/apache/casbin / RemovePolicy

Method RemovePolicy

enforcer_cached.go:99–109  ·  view source on GitHub ↗
(params ...interface{})

Source from the content-addressed store, hash-verified

97}
98
99func (e *CachedEnforcer) RemovePolicy(params ...interface{}) (bool, error) {
100 if atomic.LoadInt32(&e.enableCache) != 0 {
101 key, ok := e.getKey(params...)
102 if ok {
103 if err := e.cache.Delete(key); err != nil && err != cache.ErrNoSuchKey {
104 return false, err
105 }
106 }
107 }
108 return e.Enforcer.RemovePolicy(params...)
109}
110
111func (e *CachedEnforcer) RemovePolicies(rules [][]string) (bool, error) {
112 if len(rules) != 0 {

Callers 1

TestCacheFunction · 0.95

Calls 3

getKeyMethod · 0.95
DeleteMethod · 0.65
RemovePolicyMethod · 0.65

Tested by 1

TestCacheFunction · 0.76