dynamically change the filter expression

I have an array of records. This array will display different records based on the user's permissions.

Thus I have to use a different filter based upon the user. How do i create such an expression which takes a variable function based on the user's permission -

<div ng-repeat="r in records | filter:{isVisible:true}"

The above has a filter expression {isVisible:true}. I want to dynamically assign a different filter expression based on the user. So user2 will have {isCommon: 'M2'}.

Filter expressions can be variables too:

<li ng-repeat="item in items | filter:filterExpr">{{item.name}}</li>

Where the expression is defined on the scope:

$scope.filterExpr = { tester: true };

Here's a Plunker that demonstrates this more completely: http://plnkr.co/edit/Au8KFg?p=preview

PS: Do pay heed to @MarkRajcok's comment to your post as it is very important to note.

2Terry Drozdowski - absolutely right: filter doesn't work on Boolean for recent version(1.1.7). Thank you for pointing this out - you have to use quotes:

<div ng-repeat="r in records | filter:{isVisible:'true'}"