diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index c13f47d..c1d2544 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -1488,6 +1488,23 @@ class Aauth { return $row->id; } + /** + * Get group + * Get group from group name or id ( ! Case sensitive) + * @param int|string $group_par Group id or name to get + * @return int Group id + */ + public function get_group ( $group_par ) { + if ($group_id = $this->get_group_id($group_par)) { + $query = $this->aauth_db->where('id', $group_id); + $query = $this->aauth_db->get($this->config_vars['groups']); + + return $query->row(); + } + + return FALSE; + } + /** * Get subgroups * Get subgroups from group name or id ( ! Case sensitive) @@ -1856,6 +1873,23 @@ class Aauth { return $row->id; } + /** + * Get permission + * Get permission from permisison name or id + * @param int|string $perm_par Permission id or name to get + * @return int Permission id or NULL if perm does not exist + */ + public function get_perm($perm_par) { + if ($perm_id = $this->get_perm_id($perm_par)) { + $query = $this->aauth_db->where('id', $perm_id); + $query = $this->aauth_db->get($this->config_vars['perms']); + + return $query->row(); + } + + return FALSE; + } + ######################## # Private Message Functions ########################