code: def declared_attr_roles(rw=None, call=None, read=None, write=None):
      
      def inner(f):
          @wraps(f)
          def attr(cls):
              # Pass f(cls) as a parameter to with_roles.inner to avoid the test for
              # iterables within with_roles. We have no idea about the use cases for
              # declared_attr in downstream code. There could be a declared_attr
              # that returns a list that should be accessible via the proxy.
              return with_roles(rw=rw, call=call, read=read, write=write)(f(cls))
          return attr
      warnings.warn("declared_attr_roles is deprecated; use with_roles", stacklevel=2)
      return inner
docs: Equivalent of :func:`with_roles` for use with ``@declared_attr``::
  
          @declared_attr
          @declared_attr_roles(read={'all'})
          def my_column(cls):
              return Column(Integer)
  
      While :func:`with_roles` is always the outermost decorator on properties
      and functions, :func:`declared_attr_roles` must appear below
      ``@declared_attr`` to work correctly.
  
      .. deprecated:: 0.6.1
          Use :func:`with_roles` instead. It works for
          :class:`~sqlalchemy.ext.declarative.declared_attr` since 0.6.1