[mythtv] multi-user subsystem

Chris Pinkham cpinkham at bc2va.org
Sat Jun 3 17:19:16 UTC 2006


* On Sat Jun 03, 2006 at 06:28:04AM -0700, Anastasiya Soboleva wrote:
> I designed new concept of MythTV multi-user system.
> Now I'm going to implement user accounts, and later
> add group accounts.
> So I propose next data model for user account. Each
> user has his own collection of information, which
> includes folder, resource counter, resource limit,
> current theme, priority and other specific info.
> Beside this user has list of channels,  plug-ins, 
> scheduled records and already made records.
> 
>  Priority (byte)– this field specify privilege for
> each user. For super user priority equals 0 and so he
> can perform any privileged operations such as:
> 1) delete scheduled records
> 2) delete records
> 3) add new user
> 4) attach plug-in
> 5) change settings

Have you considered making this a simple ACL type list
for the user.  So, you could have something like the
following permissions defined.  What I'm showing here
would be a bitmap.  You could put this into a list also,
but a bitmap is easier to parse.  This is not a complete
list, just an example, and the list of permissions can
easily be expanded later.  Permissions would be additive,
never negative so root has all bits turned on.

0x00000001 - edit normal settings _only_
0x00000002 - edit advanced settings _only_
0x00000003 - edit all settings
0x00000004 - edit users (add/delete/etc.)
0x00000010 - create new scheduled recordings (for self)
0x00000020 - delete scheduled recordings (for self)
0x00000040 - edit scheduled recordings (for self)
0x00000100 - create scheduled recordings (for all)
0x00000200 - delete scheduled recordings (for all)
0x00000400 - edit scheduled recordings (for all)
0x00001000 - user can run plugins
0x00002000 - user can watch any recordings in their
             recording group (see TV ratings description
             below).
.
.
.
0xffffffff - all-powerful user, a.k.a. root

The problem with a priority/priviledge level is that just
because I might want a user to be able to perform a particular
action, I might not want them to be able to perform all the
other actions at that level and below.  I might just want
someone to be able to add/delete users, but not necessarily
edit those users' recording schedules or delete their
recordings.

Some settings like 0x400 would allow the user to edit
all scheduled recordings whether for that particular
user or not (ie, so mom can edit the kids schedules
without having to make mom all-powerful).

Also, you may want to consider giving a user a TV rating
level as well if you haven't thought of that already.  So a
child user could be set to a rating that would only let
them watch/record childrens shows while Mom & Dad can
record anything.  With the "user can watch any recordings
in their recording grouup" ACL, then Mom and Dad could setup
new recordings for their kids above this rating if they
wanted and the child could still watch them even though they
are above their normal TV rating level.

The project description said that Myth should function
normally as it does now if no additional users are created
other than the default root, so keep that in mind when
designing things also.  If I install Myth from scratch,
it should operate fine in single-user mode and I should never
even have to think about anything user-based until I create
an additional user, at which time the ACLs would kick in and
for example mythfrontend might ask me which user I was when it
started up instead of defaulting to running as the 'root'
mythtv user.

Just for other's reference, when we are talking about
making Myth multi-user, we are not talking about making it
aware of the operating system users, we are talking about
internal access controls within Myth based on an internal
users table.  If mythfrontend had the ability to notice
that it was running as operating system user xyz when there
was also a MythTV user xyz and it made things a little easier
for user xyz to login to Myth, then that is a bonus.  I can
see people running mythfrontend on their own computers and
wanting it to be easier to have mythfrontend start as a
specific user rather than having to select the proper
username from a list all the time.

--
Chris


More information about the mythtv-dev mailing list