Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create backend logic to list all role collections #3218

Open
jeff1evesque opened this issue Mar 27, 2018 · 0 comments
Open

Create backend logic to list all role collections #3218

jeff1evesque opened this issue Mar 27, 2018 · 0 comments

Comments

@jeff1evesque
Copy link
Owner

jeff1evesque commented Mar 27, 2018

Based on our #3208, we need to adjust necessary back python logic, to incorporate the following:

List Role Collections: list all collections associated with the current role.

SELECT Collection.CollectionName
FROM Collection
LEFT JOIN PermissionCollection ON PermissionCollection.CollectionID = Collection.CollectionID
LEFT JOIN Account ON Account.RoleID = PermissionCollection.RoleID
LEFT JOIN Role ON Role.RoleTypeID = RoleType.RoleTypeID
WHERE RoleType.RoleType = 'role-1'

The above implementation will likely occur in the applications backend code.

query = '''\
        SELECT Collection.CollectionName
        FROM Collection
        LEFT JOIN PermissionCollection ON PermissionCollection.CollectionID = Collection.CollectionID
        LEFT JOIN Account ON Account.RoleID = PermissionCollection.RoleID
        LEFT JOIN Role ON Role.RoleTypeID = RoleType.RoleTypeID
        WHERE RoleType.RoleType = %s
        '''
args = (current_user)
cur.execute(query, args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant