• Leigh Stoller's avatar
    Bottom line on this commit: Do not update the nodetypeXpid_permissions · 775ca147
    Leigh Stoller authored
    table by hand anymore! Update the group_policies table and then run
    the script to update the permissions table (sbin/update_permissions).
    
    Details:
    
    My original thought when I started this was that I would be able to
    replace the existing nodetypeXpid_permissions table with this new
    stuff. Well, it turns out that this was not a good thing to do, for a
    couple of reasons:
    
      * Engineering: We access the nodetypeXpid_permissions table from three
        different languages, and no way I wanted to rewrite this library in
        in python and php!
    
      * Performance: We access the nodetypeXpid_permissions from the web
        interface, on every single page load. In fact, we access it twice if
        if you count the FreePCs() count that we put at the top of the menu.
        Going through this library on each page load would be a serious drag.
    
    So, rather then actually get rid of the nodetypeXpid_permissions table, I
    decided to keep it as a "cache" of permissions stored in the group
    policies table. Each time you update the policy tables, we need to run
    the update_permissions script which will call into this library (see the
    TBUpdateNodeTypeXpidPermissions() routine) to reconstruct the permissions
    table. I have whacked the grantnodetype script to do exactly that.
    
    Note that we could proably do the same thing for users by creating an
    equivalent nodetypeXuid_permissions table, mapping users to types they
    are allowed to use. That would be a lot rows, but the amount of data in
    the table is small. That would give us very fine grained control of what
    we show people in the web interface. Not sure it is worth it though.
    
    I also added some instructions to previous commit in database-migrate.txt
    on populating the new group_policies table from the existing
    permissions table.
    775ca147
Name
Last commit
Last update
account Loading commit data...
apache Loading commit data...
assign Loading commit data...
autoconf Loading commit data...
capture Loading commit data...
cdrom Loading commit data...
db Loading commit data...
delay/linux Loading commit data...
dhcpd Loading commit data...
discvr Loading commit data...
doc Loading commit data...
event Loading commit data...
firewall Loading commit data...
hw_config Loading commit data...
hyperviewer Loading commit data...
install Loading commit data...
ipod Loading commit data...
lib Loading commit data...
mote Loading commit data...
named Loading commit data...
os Loading commit data...
patches Loading commit data...
pxe Loading commit data...
rc.d Loading commit data...
robots Loading commit data...
rpms Loading commit data...
security Loading commit data...
sensors Loading commit data...
sql Loading commit data...
ssl Loading commit data...
sysadmin Loading commit data...
tbsetup Loading commit data...
testsuite Loading commit data...
tip Loading commit data...
tmcd Loading commit data...
tools Loading commit data...
utils Loading commit data...
vis Loading commit data...
www Loading commit data...
xmlrpc Loading commit data...
BUGS Loading commit data...
GNUmakefile.in Loading commit data...
GNUmakerules Loading commit data...
GPL-COPYING Loading commit data...
LGPL-COPYING Loading commit data...
LICENSE Loading commit data...
Makeconf.in Loading commit data...
README Loading commit data...
TODO Loading commit data...
TODO.plab Loading commit data...
config.h.in Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
defs-aerolab Loading commit data...
defs-calfeld-emulab Loading commit data...
defs-davidand-emulab Loading commit data...
defs-default Loading commit data...
defs-duerig-emulab Loading commit data...
defs-elabinelab Loading commit data...
defs-example Loading commit data...
defs-fish-emulab Loading commit data...
defs-gatech Loading commit data...
defs-kwebb-emulab Loading commit data...
defs-newbold-emulab Loading commit data...
defs-newbold-macdb Loading commit data...
defs-ricci-emulab Loading commit data...
defs-shash-emulab Loading commit data...
defs-stoller-emulab Loading commit data...
defs-stoller-home Loading commit data...
defs-stoller-lbsdb Loading commit data...
defs-uky Loading commit data...
defs-wide Loading commit data...