you would have database tables like this
users
id
name
<etc>
groups
id
name
<etc>
pages
id
name
<etc>
users_to_groups
id
user_id
group_id
pages_to_groups
id
pg_id
group_id
Now when a page gets added, the groups that can access that page are associated with that page. Users are associated with groups and so users can access pages which any of their groups can access. It all becomes a couple simple queries. The owner of the page should be the one who defines access rights to that page. When someone creates a page they can make it be owned by any of their groups for example.
Joe Smith belongs to groups general, accounting and jsmith
Bill Smith belongs to groups general, billing and bsmith
Alice Smith belongs to groups general, accounting, billing and asmith
Joe Smith creates a document (passed_due_accounts.txt) and makes it be owned by accounting but viewable by billing and jsmith. Now Alice or Joe can modify the document while Bill can only look at it.
Alice creates a document (employee_salaries.txt) and makes it owned by asmith and viable by accounting. So only she can modify it while Joe can look at it and Bill is oblivious to its existence.
Bill makes a document (why_alice_sucks.txt) and makes it owned by bsmith and vieable by jsmith. So only he can modify it but Joe can view it while Alice is oblivious to its existence.
Now let's say you hire John Doe and he's in billing. You just make hime a member of billing and he can view all the documents viewable by billing and edit all of the documents owned by billing.
Is this making sense.