Blow user:site_owner cache when granting/revoking 'owner' role

This commit is contained in:
Brion Vibber 2011-02-17 16:46:08 -08:00
parent ccdd47bdb4
commit 98b1fe07c6

View File

@ -752,6 +752,10 @@ class Profile extends Memcached_DataObject
throw new Exception("Can't save role '$name' for profile '{$this->id}'"); throw new Exception("Can't save role '$name' for profile '{$this->id}'");
} }
if ($name == 'owner') {
User::blow('user:site_owner');
}
Event::handle('EndGrantRole', array($this, $name)); Event::handle('EndGrantRole', array($this, $name));
} }
@ -780,6 +784,10 @@ class Profile extends Memcached_DataObject
throw new Exception(sprintf(_('Cannot revoke role "%1$s" for user #%2$d; database error.'),$name, $this->id)); throw new Exception(sprintf(_('Cannot revoke role "%1$s" for user #%2$d; database error.'),$name, $this->id));
} }
if ($name == 'owner') {
User::blow('user:site_owner');
}
Event::handle('EndRevokeRole', array($this, $name)); Event::handle('EndRevokeRole', array($this, $name));
return true; return true;