<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def invalidate_permissions_cache(self):
 """ In the event that the Permission table is changed during the use of a permission the Permission cache will need to be invalidated and regenerated. By calling this method the invalidation will occur, and the next time the cached_permissions is used the cache will be re-primed. """

        if self.user:
            self.user._authority_perm_cache_filled = False
        if self.group:
            self.group._authority_perm_cache_filled = False