Added user counter to resources

User counter in resources allows to release the allocation and to only
allocate resources of passes that got validated.
Not tested. Still in progress. Must create test cases.