function fp_get_permissions_for_role

6.x db.inc fp_get_permissions_for_role($rid)
4.x db.inc fp_get_permissions_for_role($rid)
5.x db.inc fp_get_permissions_for_role($rid)
1 call to fp_get_permissions_for_role()
fp_load_user in includes/db.inc
Returns back a user object for this user_id. If the user is not found in the users table, it will return NULL. If the user_id requested is 0, the anonymous user object is returned.

File

includes/db.inc, line 710
This file contains mostly db shortcuts.

Code

function fp_get_permissions_for_role($rid) {
  $rtn = array();
  $res = db_query("SELECT pid, perm FROM role_permissions
                   WHERE rid = ?                   
                   GROUP BY perm
                   ORDER BY perm", array($rid));
  while ($cur = db_fetch_array($res)) {
    if (!in_array($cur ['perm'], $rtn)) {
      $rtn [$cur ["pid"]] = $cur ["perm"];
    }
  }
  return $rtn;
}