Notes:
A RealmOwner exists for every realm, even the default realms. The
default realm values are like the "null" record. They aren't true
"owners" of a realm. This will be discussed on the next slide. However,
it is convenient to be able to treat the default realms as any other
realm for RealmRole.
The distinction between a RealmOwner and Realm is a subtle one.
Next slide will discuss
Bivio::Auth::Realm in detail.
RealmOwner records are not linked to any other table. Whenever a
User or
Club model is
created, a corresponding RealmOwner record is created whose
realm_id is the user_id and club_id, respectively. The relationship
cannot be constrained due to the inverse order of creation.
These
numeric values do not collide in bOP. (Indeed, all instance identifier sequences
are globally unique.)
There are three default realms: Club, User and General.
These realms do not have owners, but they do have RealmOwner records.
That is, no records are owned by the default realms except for the
RealmOwner and RealmRole records. The existence of these RealmOwner
records solves the "null" instance problem in a few cases that would
be otherwise cumbersome to program. More details on the subject
of these realms in the following solids.
The rest of the data in the RealmOwner model gives the realm a
handle for email addresses and logging in, a display_name to
show in menus and titles, a password (only valid for users),
a realm_type to identify which
Bivio::Auth::Realm class to load, and a creation_date_time for auditing and
display purposes.