telmiger
Posts: 61
|
Posted: 06/28/2004, 9:18 PM |
|
I am trying to acomplish the following.
I have project and to each project can have multiple employees assigned to it.
An employee can add or edit information only in projects that he is assigned too.
I put the following code in the after initialize event. project_employee contains the employees assigned to the project.
global $conversations1;
global $DBcns;
$current_project = CCGetParam("project_id", "");
if ($current_project != 0 && CCGetUserID() != CCDLookUp("user_id", "project_employee", "project_id=".
$DBcns->ToSQL($current_project, ccsInteger), $DBcns))
{
$conversations1->InsertAllowed = false;
$conversations1->UpdateAllowed = false;
$conversations1->DeleteAllowed = false;
}
The code works if only 1 person is assigned to the project. I am not sure on how to turn this code into an array so it will compare the UserId to multiple entries in the project_employee table.
Any help would be appreciatet.
Tony Elmiger
|
|
|
|