[Gambas-user] how to start a file?

Robert JUHASZ robert1juhasz at ...626...
Mon Sep 28 13:25:03 CEST 2009


Hi,

Probably I'll try to do it directly with the files as you told.
About the project: it is a small project follower with different users. And
I only want to make the files accesible for those who participate in the
project. So it isn't possible to define on the system level. The best could
have been to have a password for the main folder so the users could access
the files only through my application.

I suppose that when creating a directory or copying a file by Gambas, I
cannot define/change the attributes. At leas with VB I couldn't.

OK, maybe I need to reconsider if I find a better way for storing the files.

Regards, Robi

2009/9/27 Doriano Blengino <doriano.blengino at ...1909...>

> Robert JUHASZ ha scritto:
> > Hello,
> >
> > I'm very happy with this solution and was perfect as long as I used my
> > program myself.
> > Now I wanna put it in a common folder on the server and for storing the
> > files I'll use a folder. To avoid the direct access of this folder, I'll
> > make it protected.
> >
> > The question now is how can I handle this kind of folder from Gambas. I
> > don't wish to deal with the rights of teh folder. The idea is to give a
> read
> > and write password to the folder and use the password from Gambas
> according
> > to the user rights in Gambas.
> >
> > - the files will be displayed by a file view control. Is there any place
> of
> > this control to enter (from code) the reading / writing password of the
> > folder used by the control?
> >
> > - or, when using the Desktop.Open function, can I specify if I open the
> file
> > for read only?
> >
> Complicated matter... I don't understand well, but I will try to add
> some information you may miss.
>
> First of all, at the file system level there could be everything you
> need. A file can be made not accessible, or readonly, or fully writable,
> to every single user of the computer. This is not so simple, however,
> because when two different users must share some privileges, you must
> use groups and things get messy. Even so, protecting a folder has
> different effects than proteting files. For example, if you
> write-protect a folder, you only assure that in that folder no files
> will be added or deleted, but single files will remain writeable. I bet
> this is not what you intended. On the other hand, if a file (not its
> folder) is write protected to a user, then that user will have no way to
> modify the file - every program will open that file in read-only mode.
> To prevent the file from being deleted, its folder must be protected,
> not the file itself.
>
> Finally, to use such system, every user must login in the system using
> its own identifier; if you have only one copy of your program running,
> with different users alternating if front of it, then you should have
> your gambas program change user ID (there is a system call for this, but
> gambas don't seem to implement it). However, you can take advantage of
> /bin/sudo, which lets you impersonate other users. The system is
> configurable and not difficult to understand (see the manual page).
>
> About FileView control, it has no property for specifying a username,
> but you can use a textbox aside and ask the user to write its username.
>
> Desktop.Open, or any other "high level" shell function, can not "open a
> file read-only"; it is the final program that must be instructed to work
> in read-only, be it openoffice, or a CAD, or anything else. Perhaps not
> all the program can be instructed to do so. It is possible, however, to
> protect the file before launching the application, and remove the
> protection afterward, Or the file can be copied elsewhere and then
> opened, alerting the user that modifications will be lost.
>
> I don't know what you are trying to do, and what your final system
> should look (one computer? many? Several system-level users? Just one?)
> but the final solutions could be to manage the access rights inside the
> program - your program asks for credentials, and then decides what to
> show, what to open read-only and what to permit to be modified or deleted.
>
> There are add-ons for Linux which permit, at the filesystem level, to
> use ACLs (access control list). This way you can more easily grant
> permissions to single users without getting crazy with users and groups.
> Or you can make several folders with different permissions (one
> writeable to anyone, another only readeable to everyone, and so on).
>
> Hope I pointed out some useful idea,
> regards,
>
> --
> Doriano Blengino
>
> "Listen twice before you speak.
> This is why we have two ears, but only one mouth."
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list