it seems you are just trying to check the value of another $scope variable ( the one from the directive ) in your main controller
In order to have the same one, you can pass it as another attribute in your directive
I let you check this fiddle : http://jsfiddle.net/DotDotDot/Ahe2X/22/
I just modified 3 little points :
First, I created the masterChecked value in the main controller :
cmdApp.controller('UserController', function($scope) {
$scope.masterChecked=false;
....
we add the masterChecked value in the directive's scope, in order to have the same variable everywhere
scope: { checkboxes: '=', masterChecked:"=" },
then, we can call the directive with another attribute :
<three-state-checkbox checkboxes="users" class="select-all-cb" master-checked="masterChecked">
And now, you are manipulating the masterChecked variable from your main controller in your directive, and it works :)