[Beaker-devel] New sub-command to list access policy for a system

Amit Saha asaha at redhat.com
Wed Sep 25 07:31:57 UTC 2013



----- Original Message -----
> From: "Nick Coghlan" <ncoghlan at redhat.com>
> To: beaker-devel at lists.fedorahosted.org
> Sent: Wednesday, September 25, 2013 5:09:03 PM
> Subject: Re: [Beaker-devel] New sub-command to list access policy for	a	system
> 
> On 09/25/2013 04:25 PM, Amit Saha wrote:
> > ----- Original Message -----
> >> From: "Dan Callaghan" <dcallagh at redhat.com>
> >> PrettyTable sounds nifty, I'd never heard of it before.
> 
> Indeed, would have been handy back when I was working on the client for
> PulpDist.

That is where, a lot of the time this morning went into,  but it does indeed 
look like a good find. And we don't need to resort to .format()'s mini-language 
to get it right.

> 
> >> I'm not sure a table is a good way to represent the rules though. A rule
> >> applies either to a particular user, a particular group, or everybody.
> >> The table view doesn't really make that easy to see (especially for the
> >> "everybody" case) which is why I had suggested just the plain listing of
> >> rules.
> > 
> > I am going to push this a little further :-).
> > 
> > I made some changes and now the output is:
> > 
> > +------+----------------+--------+---------+-----------+
> > | Rule |   Permission   |  User  |  Group  | Everybody |
> > +------+----------------+--------+---------+-----------+
> > |  1   |  edit_system   | user10 |    X    |     X     |
> > |  2   | control_system | user11 |    X    |     X     |
> > |  3   | control_system |   X    | group12 |     X     |
> > +------+----------------+--------+---------+-----------+
> > 
> > How do you find it?
> 
> So, ordered by permission and displaying "yes" in the Everybody column
> when neither user nor group is specified?
> 
> Sounds reasonable to me.

Not exactly what I have done, but yes certainly can be done.
PrettyTable can even sort by a header [1].


> 
> We may want a "show-permissions" command, too. Similar to the one liner
> "What are *my* permissions?" we were discussing for the web UI.

Sure, sounds like a good idea.

[1] http://code.google.com/p/prettytable/wiki/Tutorial#Sorting_tables

Best,
Amit.

-- 
Amit Saha <http://echorand.me>
Infrastructure Engineering and Development
Red Hat, Inc.


More information about the Beaker-devel mailing list