Hi,
We are not publishing night builds.
If you do not want an user to add/edit contacts, you must uncheck "can manage contacts" at user's permissions view.
This fix in this thread was made to allow users who cannot manage contact but has write permissions on a workspace, to add/edit only contacts which belongs to that workspace.
But if the user has "can manage contacts" checked he can edit every contact.
I think the best solution for you is to uncheck the 'can manage contacts' permission for the users you don't want to allow them, and if you want you can give them permissions in specific ws.
To make fix you have to edit the file 'application/models/contacts/Contact.class.php'
add the function
function canWriteByRoles(User $user){
$roles = $this->getRoles();
if (is_array($roles)) {
foreach ($roles as $pc) {
$p = $pc->getProject();
if ($user->getProjectPermission($p, ProjectUsers::CAN_WRITE_CONTACTS)) {
return true;
}
}
}
return false;
}
And then overwrite the functions canAdd(), canEdit() and canDelete() with this ones:
function canAdd(User $user, Project $project) {
return can_manage_contacts($user, true) || $this->canWriteByRoles($user);
} // canAdd
function canEdit(User $user) {
if($this->getUserId()){
// a contact that has a user assigned to it can be modified by anybody that can manage security (this is: users and permissions) or the user himself.
return can_manage_contacts($user, true) || can_manage_security($user) || $this->getUserId() == $user->getId() || $this->canWriteByRoles($user);
}
else
return can_manage_contacts($user, true) || $this->canWriteByRoles($user);
} // canEdit
function canDelete(User $user) {
return can_manage_contacts($user, true) || $this->canWriteByRoles($user);
} // canDelete
greetings