Author Topic: Permissions for write and not modify.  (Read 2487 times)

0 Members and 1 Guest are viewing this topic.

Bryco

  • Water Moccasin
  • Posts: 1883
Permissions for write and not modify.
« on: July 01, 2010, 09:15:41 PM »
We have a projectdata drive with job folders that include drawings, graphics and documents etc.
Project manglers need to be able to create subfolders but not move, delete the entire folder. I can't figure out how to set this without code, but I'm hoping someone knows how and then I will try to do it in code. We have lost entire jobs and our IT man hasn't been able to come up w/ a solution.

uncoolperson

  • Guest
Re: Permissions for write and not modify.
« Reply #1 on: July 02, 2010, 12:33:39 AM »
could you set the security on files so they can't fool with them, but set the security on the directories so they can?

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Permissions for write and not modify.
« Reply #2 on: July 02, 2010, 02:11:34 AM »
In Windows that is not possible. We also lost data because people accidentally move while doubleclicking in Explorer.

For AutoCAD you could use Vault, that is a document management program that looks like some Explorer but you can give rights to read and write on folders and files, also have automatically previous versions, etc. Else you can write your own Explorer-like dialogs where it is not possible to move or delete.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

pkohut

  • Guest
Re: Permissions for write and not modify.
« Reply #3 on: July 02, 2010, 03:30:39 AM »
In Windows that is not possible. We also lost data because people accidentally move while doubleclicking in Explorer.

For future reference, UNDO is available in Explorer for most operations. I've done the drag/move thing to some unknown folder and undo has worked.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Permissions for write and not modify.
« Reply #4 on: July 02, 2010, 03:41:29 AM »

True Paul, but by the time most people realize they've fluffed it it's too late to undo.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Permissions for write and not modify.
« Reply #5 on: July 02, 2010, 03:57:26 AM »
Unfortunately the most of my colleagues don't even know what happened or that THEY did it :-)
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Glenn R

  • Guest
Re: Permissions for write and not modify.
« Reply #6 on: July 02, 2010, 06:46:30 AM »
Bryco,

It's under special permissions for the security for the folder. From memory, Deny 'Delete Files' and 'Delete Folder'.
I've worked at places where the root project directory had special permissions like this. Users could create, files and sub-folders, write to them, but couldn't delete them, except their own.

This stopped that accidental drag and drop of a whole project somewhere else in the tree, which can be very annoying.

Cheers,
Glenn.

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Permissions for write and not modify.
« Reply #7 on: July 02, 2010, 07:00:22 AM »
Thanks, I'll p[lay with that. Write  without modify seems to be the  the permission I want but it wont allow me to check no modify and yes to write. Like you say the special permissions seem to have more options.
Did you set these for the drive or for each folder?

Glenn R

  • Guest
Re: Permissions for write and not modify.
« Reply #8 on: July 02, 2010, 07:04:36 AM »
I didn't do this - it was the IT dept. I just vaguely remembered it form years ago and confirmed it briefly with someone at my present place of daytime habitation.

I think you try enabling most things, but specifically ticking deny delete - I think that will overwrite any inherited permissions or clashes. It was done on the 'project' root folder ie the folder on the drive that contains each project's folder and sub-folders...does that make sense?

If you get it sussed, post it back here as I'm not entirely sure of the specifics myself...was back in OZ...

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Permissions for write and not modify.
« Reply #9 on: July 02, 2010, 07:09:19 AM »
Good , I'll try that when I get to work

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Permissions for write and not modify.
« Reply #10 on: July 02, 2010, 07:26:28 AM »
Huiz, I haven't tried vault as I heard it was a memory hog and our server is pretty slow, do you like it?

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Permissions for write and not modify.
« Reply #11 on: July 02, 2010, 07:30:55 AM »
Huiz, I haven't tried vault as I heard it was a memory hog and our server is pretty slow, do you like it?

No, not at all, but it was an option  :-P
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Permissions for write and not modify.
« Reply #12 on: December 22, 2010, 07:11:42 PM »
I've finally had time to play with this.
It was no good trying to set permissions for the whole drive as Users need more permissions for specific folders.
Share is set to everyone full.
Cadusers and Users get readonly for the drive.
Then Cadusers get full control for each Job folder (Subfolders and files)
Users get full control for specific subfolders.

The code is simple to give the permissions
Code: [Select]
        private static void AddFullcontrol(string sFolder, string sAccount)
        {
            Document doc = acadApp.DocumentManager.MdiActiveDocument;
            Editor ed = doc.Editor;
            bool bMod;
            AccessControlType allow = AccessControlType.Allow;
            InheritanceFlags inherit = InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit;
            PropagationFlags pInherit = PropagationFlags.None;
            if(sAccount==@"LEX\CadUsers")
                pInherit = PropagationFlags.InheritOnly;

            FileSystemRights fullcontrol = FileSystemRights.FullControl;
            DirectoryInfo DirInfo = new DirectoryInfo(sFolder);
            DirectorySecurity dSecurity = DirInfo.GetAccessControl();
            FileSystemAccessRule fsaWrite = new FileSystemAccessRule(sAccount, fullcontrol, inherit, pInherit, allow);
            dSecurity.ModifyAccessRule(AccessControlModification.Add, fsaWrite, out bMod);
            DirInfo.SetAccessControl(dSecurity);
            ed.WriteMessage(Environment.NewLine + sFolder + "=" + bMod.ToString());

        } // end AddFullcontrol
and since I make the folders, I add the permissions as I make them.

The hard part was the folder on the drive bought permissions with it that never showed up, so whatever I did didn't work until I unticked inherit from parant and made a copy.