Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Take Ownership on Save (File permissons like UNIX)

Status
Not open for further replies.

MSPBenson

Mechanical
Jan 13, 2005
190
Has anyone found a way of getting file permissions in windoze to act like Unix?
We have more than one user working on the same assy's at any one time. If they hit save in the assy it will save all components UG thinks are modified including files that other users may be working on. This can cause loss of work due to "file modified on disk".
I'd like to set up permissions so that only the owner of a file can save it.
To change ownership in Unix all you had to do was open up the file to everyone. The user who wants ownership opens it then saves it. This then changes the ownership to them.
That's the bit I can't get to happen in Windoze. If a user saves a file the original user still owns it and the permissions of the file are never changed so both users can save to the file.

Any ideas/ current working practices would be appreciated.

Thanks in advance,


Mark Benson
CAD Support Engineer
 
Replies continue below

Recommended for you

If you are using NX2 or newer, your users could use the "Save work part only" option, which will keep the components from saving.

-Dave
Everything should be designed as simple as possible, but not simpler.
 
Dave

It's much quicker when you are quitting out of UG to hit save on the assy. you don't need to remember what you have/haven't modified. Over the course of a day this could be 20 parts to try and remember.
Also there's nothing to stop them doing it the old way instead of using the save current part so it's not fool proof.

I've made some progress.
The process I want is as follows:

User 1 creates part therfore User 1 owns part. (Done as default in windoze)

No other user can modify/save the part until user 1 opens permissions. (Can be set using inheritable permissons from directory)

User 1 opens permissions to user 2. (Using built in permissions GUI in windoze)

User 2 saves file and becomes owner (Using a free util that can change the owner at command line through a user exit)

During the user exit I want to remove all other permissions that might have been added other than the dafault inherited permissions for the containing folder.
This I'm stuck on.

Any ideas would be great.

Cheer,

Mark Benson
CAD Support Engineer
 
Agreed. I do the same thing at the end of the day :)

Sounds like you need a lightweight PDM system, to allow files to be saved only by the user that has it "checked out", while other users are still able to "view" the file.

-Dave
Everything should be designed as simple as possible, but not simpler.
 
try this:
Cad-OasEs
google with it.
thats a retty small solution
uwe
 
Thanks for the comments but I'm not keen on trying to implament a PLM/PDM program to handle something a unix operating can do without configuration.
I've managed to solve this now using 2 small programs off the net and a little grip.

For anyone interested the routine is as follows:
------------------------------------------------
$$ PROGRAM: CHOWN.GRS
$$
$$ KEYWORDS: Changes ownership of file while saving and
$$ re-sets file permissions
$$
$$ RELEASE HISTORY::
$$ V1.0 18/11/05 First Release
$$
$$ Required Subroutines: chown.exe, xcacls.vbs
$$
$$ REQUIRED DATA/PART FILES: (NONE)
$$
$$ AUTHOR: Mark Benson
$$ TITLE: CAD Support Engineer
$$ COMPANY: HoZelock Ltd
$$ --------------------------------------------------------
string/filename(132),owner(132),arglst(132)
string/arg1(132),arg2(132),arg3(132)

$$ Save part file if successful change perms else stop
FILE/PART,iferr,NOPERM:

$$ Get Current Filename & path
filename=partop/ASK,work

$$ Get Current logged in user name
owner=envvar/'username',ASK

$$ Create an argument list using variables and change
$$ Ownership of part file
arglst=' '+owner+' '+filename
xspawn/prog,'Z:\pend\grip\chown.exe',arglst

$$ Change permissions of file to full for creator/owner
$$ Full for Admin & read only for Everyone else
arg1=' '+filename+' /g \"creator owner":f'
XSPAWN/ 'cmd.exe', '/c', 'Z:\pend\grip\xcacls.vbs'+arg1
arg2=' '+filename+' /e /g \administrators:f /g \everyone:x'
XSPAWN/ 'cmd.exe', '/c', 'Z:\pend\grip\xcacls.vbs'+arg2


JUMP/ENDPROG:

NOPERM:

$$ Error on failure to save part
$$ !Warning! could mask other save errors
MESSG/'INSUFFICIENT FILE PERMISSIONS'


ENDPROG:
$$ Set step over of save for user exit
&UEXERR = 1
HALT
---------------------------------------------------

Both chown.exe and xcacls.vbs can be found with a google.

I've set our folder permissions up as :
owner/creator - Full Access
Admins - Full Access
Everyone - Read Access

This means all new files in this folder have the default file permissions and any subsequent saves re-set file permissions.

This means that the owner is the only true user who can save the file (no one should run CAD as admin). If another user wants to modify a file the owner(or admin) must edit the permission of the file for that user to have full access.
When the 2nd user saves he/she takes ownership and then only they have write access.
This permissions system now reacts very similar to unix.

If anyone has any comments or a better/simpler solution I'd be greatful for the input.

Mark Benson
CAD Support Engineer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor