This is the sqlalchemy problem - I would rather have a means of having one
user role table and in some fashion link all three tables folder collection
module to it - but sqlalchemy really does not like broken normaliasation -
so the two obvious approaches (ie textual representation of the type in a
field or a join table) lead to some horrible sqlalchemy code (even by the
author in StackOverflow - he kind of said don't do this iirr)

In the end a security table per type seemed the best compromise - comments
?

Paul Brian
07540 456 115
paul@mikadosoftware.com
Guiding you towards Continuous Delivery of software and business value.

On 18 Mar 2013, at 19:58, Philip Schatz <notifications@github.com> wrote:

In rhaptos2/repo/foldermodel.py:

> +        """ allow each Folder / collection class to have a set_acls call,
> +        but catch here and then pass generic function the right UserRoleX
> +        klass.  Still want to find way to generically follow sqla"""
> +        super(Collection, self).set_acls(owner_uuid,
> +                                         aclsd, UserRoleCollection)
> +        db_session.add(self)
> +        db_session.commit()
> +
> +
> +################# Modules ##################################
> +
> +class UserRoleModule(Base, CNXBase):
> +    """The roles and users assigned for a given folder
> +    """
> +    __tablename__ = 'userrole_module'
> +    module_uri = Column(String, ForeignKey('cnxmodule.id_'),

UserRoleModule seems to differ only in module_uri; could/should these be
merged instead of copy-pasted?

—
Reply to this email directly or view it on
GitHub<https://github.com/Connexions/rhaptos2.repo/pull/91/files#r3419440>
.

-- 


www.mikadosoftware.com

See your software improve with every change.