Link to home
Start Free TrialLog in
Avatar of rwallacej
rwallacej

asked on

ASP.net - automatically give user their own directory

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!
SOLUTION
Avatar of jeebukarthikeyan
jeebukarthikeyan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rwallacej
rwallacej

ASKER

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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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/questions/22931714/Set-File-Folder-permissions.html?sfQueryTermInfo=1+folder+permiss+vb.net
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
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
thank-you