Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Mass Assign a User Role
estrawmiller
#1 Posted : Friday, 20 May 2011 10:30:55 AM(UTC)
Rank: Member

Joined: 19/01/2011(UTC)
Posts: 5
Location: Princeton

Hi,

I am wondering if there is a way to mass assign (or even globally assign) user roles:

User account info is being pulled from Active Directory, and I would like to globally assign all of those users to the _View All Albums role.

Is there a way to do this?

Thanks!
Roger Martin
#2 Posted : Friday, 20 May 2011 11:37:25 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

The easiest way would be to download the source code version and get it running against your AD and SQL database. Then modify the GalleryController.InitializeGspApplication() function to loop through the users and add each one to the desired role. Use the functions in UserController and RoleController to get the job done.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
estrawmiller
#3 Posted : Monday, 23 May 2011 6:53:12 AM(UTC)
Rank: Member

Joined: 19/01/2011(UTC)
Posts: 5
Location: Princeton

This is for an existing set-up. I don't quite understand how this would help?

Thanks!
Roger Martin
#4 Posted : Monday, 23 May 2011 7:46:27 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

My instructions outline a process that puts all of your existing users in a particular role. Isn't that what you want?
Roger Martin
Creator and Lead Developer of Gallery Server Pro
estrawmiller
#5 Posted : Monday, 23 May 2011 8:53:12 AM(UTC)
Rank: Member

Joined: 19/01/2011(UTC)
Posts: 5
Location: Princeton

Before the last upgrade, all of the users that were attached to GSP via AD automatically were able to view all of the albums.

After the upgrade, as soon as a user from the community logs in, they only can see an album if they've been assigned the owner role... not the remaining/exisiting albums.

Anyone who has a link but who does not log in can see all of the albums (except for those marked 'private').

This doesn't make sense to me - that those in AD can't see things once they log in vs. if they don't log in, they can see everything.

Hence, it would be great to give all users in AD the 'view all albums' role by default.

So really, it's not just existing users, it's all users tied to the db via AD.
Roger Martin
#6 Posted : Monday, 23 May 2011 9:59:14 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

Role membership provides security for logged on users. The privacy setting controls visibility to anonymous users. Those are separate systems, so it is entirely possible to have a gallery where anonymous users can see albums that are hidden once logged on.

I can't speak to what might have changed during the upgrade (which shouldn't have), but the fix is exactly what you originally suggested and my answer still applies. You need to assign each user to a role with view permissions to the gallery. There are three ways to do this:

1. Use the Manage Users page to manually assign each user to the role. This would be best for 25 users or less.

2. Open the source code version of GSP in Visual Studio. Configure the gallery data provider, membership, and roles in web.config just like your production system. Then use the ASP.NET Configuration Tool (icon is at the top of the Solution Explorer) to assign each user to the role. This would be best for 25-200 users.

3. Write a bit of code to loop through all the users and assign each one to a role (like I originally suggested). This would be best for 100 or more users.

By the way, I don't really understand your last comment "it's not just existing users, it's all users tied to the db via AD". GSP doesn't store a list of users, so the accounts in AD are "all users" as far as GSP is concerned.

Hope this helps.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.