Change Permissions on Photo's

Topics: Help
Jun 14, 2007 at 10:09 AM
Hi

How could I cange the permission to post photo's from administrators to Bloggers. I have people in my club that want to post photo's, and I trust them enough not to abuse that permission, but I dont want them having administrator rights.
Coordinator
Jun 14, 2007 at 8:05 PM
On the photos/content.aspx page, I would change the following:

 Private IsAdmin As Boolean
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        IsAdmin = User.IsInRole("Administrators")
        uploadpanel.Visible = IsAdmin
        deletealbum.Visible = IsAdmin
    End Sub

to

Private IsAdmin As Boolean
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        IsAdmin = User.IsInRole("Administrators")
        If User.IsInRole("Blogger") = True Then
            IsAdmin = True
        End If
        uploadpanel.Visible = IsAdmin
        deletealbum.Visible = IsAdmin
    End Sub
Jun 14, 2007 at 8:16 PM
cheers z2, your the man, just one thing, my blogger cant create a album, is that easy to change as well?

Thanks again
Coordinator
Jun 21, 2007 at 5:08 AM
Yea... go into the web.config and look for this block:

<location path="photo/new.aspx">
		<system.web>
			<authorization>
				<allow roles="Administrators"/>
				<deny users="*"/>
			</authorization>
		</system.web>
	</location>

Replace it with this:

<location path="photo/new.aspx">
		<system.web>
			<authorization>
				<allow roles="Administrators"/>
                                                                <allow roles="Blogger"/>
				<deny users="*"/>
			</authorization>
		</system.web>
	</location>
Jun 21, 2007 at 8:30 PM
I have changed the content in the photos/content.aspx folder to:

Private IsAdmin As Boolean
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
IsAdmin = User.IsInRole("Administrators")
If User.IsInRole("Blogger") = True Then
IsAdmin = True
End If
uploadpanel.Visible = IsAdmin
deletealbum.Visible = IsAdmin
End Sub

And in web. Config page to:

<location path="photo/new.aspx">
<system.web>
<authorization>
<allow roles="Administrators"/>
<allow roles="Blogger"/>
<deny users="*"/>
</authorization>
</system.web>
</location>


And can not have members post photo's ???
Jun 21, 2007 at 9:26 PM
Have you have made your members bloggers as they are not bloggers by default?
Coordinator
Jun 21, 2007 at 10:07 PM
lhr, you set the configuration for the photos to be acessible by Bloggers and Administrators, not all members.
Jun 21, 2007 at 10:27 PM
Edited Jun 22, 2007 at 2:28 AM
Dazalock

Yes I check the Blogger box for the member.
----------------------------------------------------------
z2bass

I followed the instructions you posted. I coped and pasted your post to each page
I under stand Photos are accessible by Administrators, but by giving BLoggers
( If User.IsInRole("Blogger") = True Then
IsAdmin = True ) They can edit and delete all pictures and albums?
Jun 21, 2007 at 11:23 PM
Edited Jun 22, 2007 at 2:31 AM
Ok
When the user clicks Photos, it goes to: /New%20Folder/photo/list.aspx.
Whe they click on piture it goes to: /New%20Folder/photo/contents.aspx?Albumid=26
This is good but they can edit or delete any album.

<location path="photo/new.aspx">
<system.web>
<authorization>
<allow roles="Administrators"/>
<allow roles="Blogger"/>
<deny users="*"/>
</authorization>
</system.web>
</location>

How can they create their own album? Then will they only be able edit and remove their own??

Coordinator
Jun 22, 2007 at 3:31 AM
You will have to look for User.IsInRole("Administrators") on those pages and replace it with User.Identity.IsAuthenticated