[rt-users] How to find which queues a user can post to, using the cli or the db

Kevin Falcone falcone at bestpractical.com
Tue Jul 31 13:34:14 EDT 2012

On Fri, Jul 27, 2012 at 11:50:02AM +0200, Andreas Davour wrote:
> I have searched the wiki and the mailing list archive and not found any hints.
> What I'd like to do is create a list of active users, then go over that list or users, showing each and every queue that specific user have rights to post on. 
> I know how to do it in the GUI, but then I get a lot more information which I don't need, and I'd like to get the data in a way that I could pipe it for further processing on the command line. 
> Pointers to the documentation appreciated. I have looked around in the db and can't figure out how to tie the data about queue id and user id together.

The easiest code (although it's a bit complex because of the caching)
is all the checking in Elements/SelectQueue - it loads up an RT::Queue
with the appropriate CurrentUser and then calls CurrentUserHasRight -
there are some other methods like Users' WhoHaveRight that might be
interesting.  Doing this by hand in the DB is likely to be really
complex unless you understand all the relationships.  The generated
SQL is often quite hairy.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120731/5f2f4264/attachment.sig>

More information about the rt-users mailing list