We help IT Professionals succeed at work.

ASP.net - automatically give user their own directory

386 Views
Last Modified: 2013-11-07
Hi

How can I automatically create a user folder to which only they and the system administrator have access on creating user. Users will have their own "private space" to save files.

Only the administrator should have access to the createuser.aspx page - then as part of the creating new users it should create a folder matching their user name, like
e.g. www.xxx.com/data/user1
where the username is user1

This would be better than having to create usre then manually create their folder/give permissions

Thanks!
Comment
Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
thanks - I tried to put this through convertor but it didn't work (I use VB.net) - the convertor could translate
could you please translate to vb.net?
how does this handle user permissions ?

thanks
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
ok thanks I think this code will work.

I'm not sure how the permissions are handled, though, in this code ?- only the user should have access to the folder they have created and its contents - no other users can get at the folder (apart from administrator)
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
thanks for help, I now have the code creating a user folder
however, despite looking at security namespace I can't find out how to grant permissions to folder - further assistance appreciated, thanks
Hi,

Are we talking about Active Directory users?

Jos ter Doest

Author

Commented:
not sure I understand.  I'm talking about giving users who I have registered using a page with the ASP.net create user control on it. These users will be able to login from internet  - not local intranet users.
I have got the creation of user directory working but not the bit that gives the user just created (and them exclusively + administrator) access to the new directory
Thanks
Hi,

That's exactly what I meant (not local intranet users). Since they are not local intranet users I would not know how to give them folder permission. I will google for it but I'm not sure I'll find anything.

I think you need to look at a way of redirecting users away from a folder that does not belong to them.

I'll come back to you in case I've found something.

Jos ter Doest

P.S. For folder permission take a look here
https://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_22931714.html?sfQueryTermInfo=1+folder+permiss+vb.net

Author

Commented:
thank-you,

I would have thought you were able to set folder permissions programmatically, rather than having to go through the ASP.net web configuration pages...but maybe you can't
Hi,

Of course it is possible to set folder permissions programmaticly, but I thought your users are "website users" stored in a database instead of domain users.

So, for setting up folder permissions for domain users check my previous post.

Grtz, Jos

Author

Commented:
The users are "website users" stored in the ASPNETDB.MDF folder
I might resort to creating user folder/ setting folder permissions through Website--ASP.net configuration if its not simple to programmatically do the setup for permissions on adding a new user to ASPNETDB.MDF

Author

Commented:
thank-you
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.