Ignore:
Timestamp:
2006-06-20T09:49:13+12:00 (18 years ago)
Author:
mdewsnip
Message:

New authentication system: users with group "personal-collections-editor" can edit any collection starting with their username, users with group "all-collections-editor" can edit any collection, users with group "<collection>-collection-editor" can edit the <collection> collection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/cgi-bin/gliserver.pl

    r11938 r11940  
    151151    my ($user_groups) = ($user_data =~ /\<groups\>(.*)/);
    152152    foreach my $user_group (split(/\,/, $user_groups)) {
    153     if ($user_group eq "$collection-maintainer" || $user_group eq "remote-superuser") {
    154         # Authentication successful!
    155         return;
     153    # Does this user have access to all collections?
     154    if ($user_group eq "all-collections-editor") {
     155        return;  # Authentication successful
     156    }
     157    # Does this user have access to personal collections, and is this one?
     158    if ($user_group eq "personal-collections-editor" && $collection =~ /^$username\-/) {
     159        return;  # Authentication successful
     160    }
     161    # Does this user have access to this collection
     162    if ($user_group eq "$collection-collection-editor") {
     163        return;  # Authentication successful
    156164    }
    157165    }
Note: See TracChangeset for help on using the changeset viewer.