I am trying to create user specific home...
Articles and Tips: qna
01 Jun 2003
Q.
I am trying to create user specific home directories under the \\Server\SYS\Users volume. Can you tell me how to set permissions for a particular user using the NJCL? I also need to set file system space restrictions for the user.
A.
Here is an example of how to set the appropriate user permissions to a newly created folder (such as the user's home directory):
Object obj = dirContext.lookup (sPathToHomeDirectory);
NetwareDirectory directory = (NetwareDirectory)obj; Trustee trust = new Trustee ("cn=joe,ou=sales,o=novell", Trustee.TA_READ | Trustee.TA_WRITE | Trustee.TA_CREATE | Trustee.TA_DELETE|Trustee.TA_MODIFY | Trustee.TA_SEARCH | Trustee.TA_OWNERSHIP);
directory.setTrustee(trust, DirContext.ADD_ATTRIBUTE);
The following sets space restrictions for a folder:
Object obj = dirContext.lookup (sPathToHomeDirectory);
NetwareDirectory nwDir = (NetwareDirectory)obj; DirectorySpaceInformation dirInfo = new DirectorySpaceInformation();
//Divided by 4 because file system is divided in blocks of 4KBs. dirInfo.setMaxAvailable (iSpaceRestrictionKBs / 4); nwDir.setDirectorySpaceInformation (dirInfo,DirContext.REPLACE_ATTRIBUTE);
* Originally published in Novell AppNotes
Disclaimer
The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.