[Fusionforge-general] populating nss_usergroups manually

Seth Galitzer sgsax at ksu.edu
Mon May 12 23:53:37 CEST 2014


I am working out a migration path from GFAS->FF and at this point I
think I have most things covered. I started with Roland Mas' script from
a couple of years back and have made changes that I think have gotten
most of the critical data imported to where at least it can be massaged
to completion.

One of the last things to work out is unix filesystem permissions for
SCM groups/users. I was able to populate nss_users from the GFAS data
during the original import, but not nss_usergroups, as I think this
needs to happen after running normalize_roles.php, which needs to happen
after the migration script is complete.

Attached is what I think should work. I have not tested it yet, but
wanted to see if it was a sane attempt, or if there might be a better
way to deal with it. The general algorithm is to get the set of
group_ids for groups that have SCM enabled, get the set of user_ids for
members of that group, and then add them to nss_usergroups. In my case,
all members of the group should have write access to the SCM, if that
plugin is enabled at all, so I am not doing any checking if the user
should have that permission or not.

I based the frame of this on the normalize_roles.php script, and left
the plugin setup code in there as I didn't know if it was necessary or
not. I also wasn't sure what class references might be necessary, so I
included everything I thought was needed.

So please tell me if this should work, or if it's ridiculous, or if
there is a better and cleaner way to accomplish my goal. Any and all
criticism/improvements are welcome. I'll be happy to answer any
questions for clarification.

Thanks.
Seth

-- 
Seth Galitzer
Systems Coordinator
Computing and Information Sciences
Kansas State University
http://www.cis.ksu.edu/~sgsax
sgsax at ksu.edu
785-532-7790
-------------- next part --------------
A non-text attachment was scrubbed...
Name: populate_nss_usergroups.php
Type: application/x-php
Size: 1189 bytes
Desc: not available
URL: <http://lists.fusionforge.org/pipermail/fusionforge-general/attachments/20140512/424dafe6/attachment.bin>


More information about the Fusionforge-general mailing list