* hydra: project members can do stuff that the owner can do

This commit is contained in:
Rob Vermaas
2010-03-10 10:02:04 +00:00
parent f816a5a28d
commit 1c4585dae3
2 changed files with 96 additions and 3 deletions

View File

@ -139,9 +139,9 @@ sub requireProjectOwner {
my ($c, $project) = @_;
requireLogin($c) if !$c->user_exists;
error($c, "Only the project owner or administrators can perform this operation.")
unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username;
error($c, "Only the project members or administrators can perform this operation.")
unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username || defined $c->model('DB::ProjectMembers')->find({ project => $project, userName => $c->user->username });
}