Get data from one table, while setting field based on existence/value of field in another table
<p>I have the following tables:</p>

<pre><code>Websites
--------
Resource (Auto incrementing primary key)
Name
URL
group_id (ID of group of people website belongs to)

WebsitePermissions
------------------
Resource_id (Referencing resource in Websites table)
GroupMember_ID (Reference to a user in group)
Is_allowed (true/false)
</code></pre>

<p>The system basically works as follows:</p>

<p>There is a "Group" of people, the group admin can create x number of websites in the control panel, assigning the obvious values</p>

<p>That admin can then look at the other people in the group and enable/disable the ability to see/use that site with say, an On/Off switch. The default would be OFF.</p>

<p>Each user simply needs to be able to query for "All resources with group id (my group id)" but then have an additional field that checks the Permissions table to see if there is 1: A row at all, not null i.e. admin has not changed anything and 2: if there IS a row, return the true/false permission for that user</p>

<p>So the ideal output would be for x user:</p>

<pre><code>Resource     Name         URL           Group_id    IS_ALLOWED
   1        Google    Google.co.uk         17          TRUE
</code></pre>