Kimai_Database_Mysql::membership_role_allows PHP Method

membership_role_allows() public method

Check if a membership role gives permission for a specific action.
public membership_role_allows ( integer $roleID, string $permission ) : boolean
$roleID integer the ID of the membership role
$permission string name of the action / permission
return boolean true if permissions is granted, false otherwise
    public function membership_role_allows($roleID, $permission)
    {
        $filter['membershipRoleID'] = MySQL::SQLValue($roleID, MySQL::SQLVALUE_NUMBER);
        $filter[$permission] = 1;
        $columns[] = "membershipRoleID";
        $table = $this->kga['server_prefix'] . "membershipRoles";
        $result = $this->conn->SelectRows($table, $filter, $columns);
        if ($result === false) {
            return false;
        }
        return $this->conn->RowCount() > 0;
    }
Kimai_Database_Mysql