Restrict SVN Users To Certain Directories

I needed to set our SVN repository up to allow read-write access for some designers to relevant directories. We needed to prevent read-access to all other directories.

This is how it was done:

First, this line needed to be added to http.conf:

<Location /path/to/svn>
        DAV svn
        SVNPath /path/to/svn_repo
 
        AuthzSVNAccessFile /path_to/svn_serve.conf
 
        AuthType Basic
        AuthName "Subversion repos"
        AuthUserFile /authfile
        Require valid-user
</Location>

And in the ‘svn_serve.conf’ file referenced above:

[groups]
admins=admin
designers=designer1, designer2
[/]
@admins=rw
@designers=
[/templates]
@designers=rw
[/web/css]
@designers=rw
[/web/images]
@designers=rw

The first rule ( [/] ) gives admins full read-write access to the entire file tree, and ensures the designers group has no access at all. The following rules ‘turns on’ access to each directory for the designers group.

Designers can make design-related changes ( so I don’t have to :) ), and the rest of the code remains safe.

No comments | Trackback

Getting the size of an NSFont

You’d think this would work right

[NSFont fontSize]

Well that didn’t work for me. This did:

[[[(NSFont*)[option objectForKey:kFont] fontDescriptor] objectForKey:NSFontSizeAttribute] floatValue]

May this post save your some of the frustration I experienced!

Comments (2) | Trackback

Scriptaculous Draggable reverteffect Example

I had a bit of a hard time finding which arguments are passed to the reverteffect function.

Scriptaculous’ documentation is somewhat opaque:

Effect, default to Effect.Move. Defines the effect to use when the draggable reverts back to its starting position.

Hmm, no mention of any arguments passed to the reverteffect function…

Here is an example of instantiating a new Draggable with a custom reverteffect:

new Draggable( element, {
    revert: true,
    reverteffect: function( element, top_offset, left_offset ){
        new Effect.Fade( element, {
            afterFinish: function(){
                $( element ).setStyle({
                    top: '0px',
                    left: '0px'
                });
                new Effect.Appear( element );
            }
        });
    }
});

Note that the arguments top_offset and left_offset are the offsets of the draggable as it was after the drag was completed. Also note that in my custom reverteffect function I’ve reset the draggable’s top and left offsets to 0, effectively shoving it back to it’s original position.

No comments | Trackback

Chinese Study Motivation

Hey kids, if you study really hard, one day you might be able to make sense of this ludicrous story:

Story made entirely of 'shi'

I came across it at OMG Soy Sauce: This is Why Chinese is so Hard.

Geek System has more info about it here: Chinese Riddle in Which Every Syllable Is Pronounced /Shi/.

Comments (4) | Trackback