Bug 187130 - New File/Folder & Paste should be disabled when on a read only folder
Summary: New File/Folder & Paste should be disabled when on a read only folder
Status: RESOLVED INVALID
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P4 minor (vote)
Target Milestone: 2.0.1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-15 17:13 EDT by Kevin Doyle CLA
Modified: 2007-09-14 13:36 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Doyle CLA 2007-05-15 17:13:47 EDT
When right clicking on a folder that you don't have write permission to, New File/Folder and Paste should be disabled.

Paste action is already disabled on FTP/DStore Linux connections.  It's disabled on Windows if you make a folder read-only inside RSE.  If you make a folder read-only outside RSE then RSE doesn't know it's read-only.  Even if you make a folder read-only in RSE you can still create files/folders because windows write permission is never set to disabled.

-----------Enter bugs above this line-----------
TM 2.0M7 Testing
installation : eclipse-SDK-3.3M7
RSE install  : I20070514-1630
java.runtime : Sun 1.5.0_11-b03
os.name:     : Windows XP, Service Pack 2
------------------------------------------------
Comment 1 David McKnight CLA 2007-07-11 13:42:42 EDT
I've put in a chance to SystemViewRemoteFileAdapter so that New File/Folder, rename and move are not available when the folder is read-only.  This works for dstore, however, for ftp and ssh, IHostFile.canWrite() is returning true for read-only files.  Martin, do you expect this to happen for ssh?
Comment 2 Martin Oberhuber CLA 2007-07-19 15:38:21 EDT
(In reply to comment #1)
> however, for ftp and ssh, IHostFile.canWrite() is returning true for
> read-only files.  Martin, do you expect this to happen for ssh?

I checked the code, and permissions are properly set in SftpFileService#makeHostFile() line 731ff.

Are you sure that the file you checked was really read-only? Could you perhaps try again, with a breakpoint on SftpFileService line 731? I really cannot see how this could fail.

Comment 3 Kevin Doyle CLA 2007-07-19 15:53:00 EDT
Remember for SSH that setting a file/folder read only has issue's.  It works but it doesn't update the file till you refresh the grand parent.

Once I had a folder that was read-only and recognized as read-only in the Properties, I no longer saw New File/Folder.

Should it be disabling New File and Folder or just not displaying them on a read only folder?
Comment 4 David McKnight CLA 2007-07-19 15:56:47 EDT
I just tried it now (by changing permissions to a-w) and it seems to work fine on ssh for me now.  I'm not sure why it hadn't worked before.
Comment 5 Martin Oberhuber CLA 2007-07-19 16:10:23 EDT
(In reply to comment #3)
> Remember for SSH that setting a file/folder read only has issue's.  It works
> but it doesn't update the file till you refresh the grand parent.

There's a separate bug for this, isn't it?

> Should it be disabling New File and Folder or just not displaying them on a
> read only folder?

I think the actions should be there but disabled. That way the user knows that it should be possible to create a new file / folder but something must be done to enable it (i.e. set the folder writable).

Can we set this resolved now?
Comment 6 Kevin Doyle CLA 2007-07-19 16:17:15 EDT
(In reply to comment #5)
> (In reply to comment #3)
> > Remember for SSH that setting a file/folder read only has issue's.  It works
> > but it doesn't update the file till you refresh the grand parent.
> 
> There's a separate bug for this, isn't it?

Yes, bug 190904.

> 
> > Should it be disabling New File and Folder or just not displaying them on a
> > read only folder?
> 
> I think the actions should be there but disabled. That way the user knows that
> it should be possible to create a new file / folder but something must be done
> to enable it (i.e. set the folder writable).
> 
> Can we set this resolved now?
> 

Currently the actions are gone.  If we want them to be there but disabled then this should remain open. 

I think they should be there, but be disabled.  
Comment 7 David McKnight CLA 2007-09-14 13:36:00 EDT
Marking this as invalid now since, on Windows, these operations are valid.  Bug 203455 is opened to address the system-specific cases.