Changeset 390 for trunk/dns.cgi


Ignore:
Timestamp:
09/21/12 13:41:48 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Extend handling of setting permissions to keep "chained"
permissions straight. Needed mainly for locations; if the user
can manipulate them (add/edit/delete/change-on-record) then they
should be able to view them. See #10.
Also sets self_edit if user_edit is set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r389 r390  
    956956      }
    957957    }
     958    # "Chained" permissions.  Some permissions imply others;  make sure they get set.
     959    foreach (keys %permchains) {
     960      if ($chperms{$_} && !$chperms{$permchains{$_}}) {
     961        $chperms{$permchains{$_}} = 1;
     962      }
     963    }
    958964    my ($code,$msg) = changePermissions($dbh, 'group', $webvar{gid}, \%chperms);
    959965    if ($code eq 'OK') {
     
    11801186      } else {
    11811187        $permstring = 'i';
     1188      }
     1189      # "Chained" permissions.  Some permissions imply others;  make sure they get set.
     1190      foreach (keys %permchains) {
     1191        if ($newperms{$_} && !$newperms{$permchains{$_}}) {
     1192          $newperms{$permchains{$_}} = 1;
     1193          $permstring .= ",$permchains{$_}";
     1194        }
    11821195      }
    11831196      if ($webvar{useraction} eq 'add') {
Note: See TracChangeset for help on using the changeset viewer.