##// END OF EJS Templates
fix(permissions): added a common way to update private flag via repo model...
fix(permissions): added a common way to update private flag via repo model - this allows to have a one and only one way to control the flag with the business logic shared - added test for that - changed view to use this method instead of DB update and custom permissions flush - fixed a case when update of repo settings didn't flush permissions actually while it should when private flag changed

File last commit:

r5040:444b916d default
r5551:5b9b5ed2 default
Show More
interfaces.py
73 lines | 1.3 KiB | text/x-python | PythonLexer
"""
Interfaces
^^^^^^^^^^
If you want to implement framework specific extras, use these abstract
classes as bases:
"""
import abc
class BaseSession(object):
"""
Abstract class for custom session implementations.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def save(self):
"""
Called only once per request.
Should implement a mechanism for setting the the session
**cookie** and saving the session **data** to storage.
"""
@abc.abstractmethod
def __setitem__(self, key, value):
"""
Same as :meth:`dict.__setitem__`.
"""
@abc.abstractmethod
def __getitem__(self, key):
"""
Same as :meth:`dict.__getitem__`.
"""
@abc.abstractmethod
def __delitem__(self, key):
"""
Same as :meth:`dict.__delitem__`.
"""
@abc.abstractmethod
def get(self, key):
"""
Same as :meth:`dict.get`.
"""
class BaseConfig(object):
"""
Abstract class for :doc:`config` implementations.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def get(self, key):
"""
Same as :attr:`dict.get`.
"""
@abc.abstractmethod
def values(self):
"""
Same as :meth:`dict.values`.
"""