Ill write you up a quick PHP statement that pulls the table data and checks.
Ideally you should have two tables configured.
a users table which stores all of the users information, passwords, ID, username, group ID, contact details etc...
a groups table which stores the group name, its permissions and its group ID
You relate the two by pulling the column group_id from the users table and checking it against the groups table to see that it matches the admin group ID. If it does, grab the permissions available, and continue.. ill leave the last part up to you because depending how complex you need this to be..
There are tons of other ways to do this, this is just ONE way to do it.
I also threw this code together in a matter of 5 minutes so it is not tested to make sure its working.. Also make sure to sanitize the $uid var when you receive it if its coming from $_POST or $_GET.
CODE
<?php
#store db credentials in array $db[x]
$db = array(
"database" => "database1",
"username" => "dbUser",
"password" => "pass",
"host" => "localhost"
);
mysql_connect($db['host'],$db['username',$db['password']);
@mysql_select_db($db['database']) or die( "Unable to select database");
#Query users table and retrive user's group data based on provided $uid
#$uid is previously set above from your login script.
$query = "SELECT `gid` FROM `users` WHERE `uid`='$uid'"; #set our query to a variable
$result = mysql_query($query) or die(mysql_error()); #run the query, set results to $result
mysql_fetch_assoc($result); #put the query results into an array
$gid = $result['gid']; #assign group ID to a variable for easier handling
#next lets connect to the user_groups table and fetch the permissions available to us.
$query = "SELECT `gid`,`perms` FROM `user_groups` WHERE `gid`='$gid'";
$result = mysql_query($query) or die(mysql_error());
mysql_fetch_assoc($result);
################################################################################
################################################################################
################################################################################
#############PERMISSIONS CONDITIONAL STATEMENTS WILL GO HERE####################
################################################################################
################################################################################
################################################################################
mysql_close();
?>