Check if the user is assigned to any role in the project
This commit is contained in:
@@ -124,10 +124,8 @@ class ProjectPermissionModel extends Base
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return in_array(
|
return $this->userModel->isActive($user_id) &&
|
||||||
$this->projectUserRoleModel->getUserRole($project_id, $user_id),
|
$this->isMember($project_id, $user_id);
|
||||||
array(Role::PROJECT_MANAGER, Role::PROJECT_MEMBER, Role::PROJECT_VIEWER)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -159,7 +157,7 @@ class ProjectPermissionModel extends Base
|
|||||||
*/
|
*/
|
||||||
public function isMember($project_id, $user_id)
|
public function isMember($project_id, $user_id)
|
||||||
{
|
{
|
||||||
return in_array($this->projectUserRoleModel->getUserRole($project_id, $user_id), array(Role::PROJECT_MEMBER, Role::PROJECT_MANAGER, Role::PROJECT_VIEWER));
|
return ! empty($this->projectUserRoleModel->getUserRole($project_id, $user_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user