Announcement

Collapse
No announcement yet.

how to disable the delete option in subversion in Myeclipse?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to disable the delete option in subversion in Myeclipse?

    Hello
    I am using svn system to have a version control of my project. I am using Myeclipse IDE . When i am selecting a file from the svn repository there is Delete option . So the user can delete the file from the repository. I want to disable the delete option so that i can provide a facility to my project no other person can't delete my project from the repository but he can read/write my project from the repository.

    Is there any commands to disable the delete function.

  • #2
    deletion of objects

    Hi Sowjanya,
    there are 2 solutions to this problem, but you need direct write-access to the repository:
    1. Use user-management. You could set up your repository in a way that write access is restricted to persons with an account.
    For svnserve: http://svnbook.red-bean.com/en/1.0/c...-ch-6-sect-3.2
    or for apache server: http://svnbook.red-bean.com/en/1.0/c...-ch-6-sect-4.3

    2. You could use Hook-skripts to prevent deletion of files. http://svnbook.red-bean.com/en/1.0/c...-ch-5-sect-2.1

    Comment


    • #3
      If you still need to let people write to the file(s), your only option is a hook script which rejects any commit containing a delete on files you don't want deleted.

      Comment


      • #4
        hello andy

        can u send me any example project or file which is using the hook script which explains how to use hook scripts to provide protection to a file or project

        Comment


        • #5
          There are sample hook scripts in every repository. Look in the hooks directory.

          Google for svnperms.py

          Comment


          • #6
            thank you adny

            thank you andy

            Comment


            • #7
              Can you please suggest the code for prevent delete for all files

              Comment


              • #8
                First, please understand that you can't really delete anything from a Subversion repository short of a repository dump followed by a filter followed by a load - a completely "offline" operation. The best you can do is to remove files/directories/symlinks from the *next revision*. The removed stuff will still be easily seen in the prior revisions.

                As for suggesting code to prevent the removal - the "svnperms.py" hook script pointed to above can enable access control with fineness to prevent the removal operation (as distinct from add, etc.).

                Comment


                • #9
                  In my system Python is not installed.Can you please suggest the some other programming language

                  Comment


                  • #10
                    In general, any programming language can be used: C, C++, Perl, Bash, etc. There's an art to choosing which language because the wrong choice will make your life very difficult. For something this complex, I'd sady that Bash is insufficient. Python/Perl are excellent choices.

                    That said, the "svnperms.py" will need to be re-written in whatever language you choose - or something very similar in design. So, the big question is "Why not just get Python installed on your SVN server machine?" It's usually a lot easier than re-writing and re-debugging a chunk of code that's already working...

                    Comment


                    • #11
                      i installed python in my system and please give a code example to restrict the delete option in svn for particular users.

                      Comment


                      • #12
                        Since you've installed Python, please hunt down and install the "svnperms.py" scripting mentioned earlier in this thread. Possibly the best source is here: https://svn.apache.org/repos/asf/sub.../hook-scripts/

                        Comment

                        Working...
                        X