Commit 46f8d21a authored by Leigh B Stoller's avatar Leigh B Stoller

Add project writable check to profile CanEdit() method.

parent 5d2947a0
......@@ -476,8 +476,7 @@ class Profile
return $this->CanInstantiate($user);
}
function CanEdit($user) {
if ($this->project_write() ||
$this->creator_idx() == $user->uid_idx() || ISADMIN()) {
if ($this->creator_idx() == $user->uid_idx() || ISADMIN()) {
return 1;
}
$project = Project::Lookup($this->pid_idx());
......@@ -487,6 +486,12 @@ class Profile
if ($user->uid_idx() == $project->GetLeader()->uid_idx()) {
return 1;
}
if ($this->project_write()) {
$approved = 0;
if ($project->IsMember($user, $approved) && $approved) {
return 1;
}
}
return 0;
}
function CanDelete($user) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment