It actually used to be better than this. NPC had a concept of a permission set. A permission set was a group of data source access rights that could be applied to users. So, i could create one permission set called administrators and give them admin access to everything and another permission set called users and give them user access to everything. I would then assign the admin permission set to all the admins and the user permission set to all the users. If i added a new data source, all i would have to do is go to the permission set and update the permissions for that new data source and it would be applied to everyone with that permission set. However, for reasons as yet unexplained, the guys building NPC decided that was too efficient and decided on a per user definition. I guess since they already had a role component they didn't want to make role-based permissions as well. Why they didn't just roll permission sets into the roles is beyond me (i can understand technically why they didn't: because it's more versatile that way. But really, who knows enough about NPC to really use it that way?).
Anyway, if you find yourself in this situation and you don't want to have to do it manually, you can always do it in the database. Standard disclaimer: don't do this, it will break your stuff, i won't help you fix it, back up your stuff, you're on your own, don't tell support i told you to do this when you call them to have them help you fix it, etc., etc., etc.
Run the following query to turn all NPC admins into admins on all the data sources:
replace into data_source_rights (select a.UserID, b.SourceID, 1 as UserLevel from user_definitions a, data_sources2 b where a.userlevel=1 and sourceid<>0) ;
Run the following query to turn all NPC users into users on all the data sources:
replace into data_source_rights (select a.UserID, b.SourceID, 4 as UserLevel from user_definitions a, data_sources2 b where a.userlevel=4 and sourceid<>0) ;
No comments:
Post a Comment